I want to locally enable Codex Pets by overriding the cached Statsig gate, without patching app.asar.
Context:
- Codex desktop is an Electron app.
- The Pets / avatar overlay feature is gated by Statsig gate
2679188970. - The custom pet files should live under
~/.codex/pets/<pet-id>/. - The relevant cache is Chromium localStorage LevelDB at:
~/Library/Application Support/Codex/Local Storage/leveldb - The relevant localStorage keys look like:
statsig.cached.evaluations.<number> - Each value is an outer JSON object with a stringified JSON
datafield. Insidedata.feature_gates, add: { "2679188970": { "name": "2679188970", "value": true, "rule_id": "local_override", "id_type": "userID", "secondary_exposures": [] } }
Please do this carefully:
- First verify my pet package exists and is valid under
~/.codex/pets. - Do not edit
.ldbfiles as text. - Use a LevelDB-aware tool/library, for example Node with
classic-level. - Make a full backup of the LevelDB directory before writing.
- Dry-run against a copied snapshot first and report which
statsig.cached.evaluations.*keys are patchable. - Patch every parseable cached evaluation key, not just one.
- Codex must be fully quit before patching the live DB, because the LevelDB is locked while Codex is running.
- Do not use
launchctl submitfor the restart flow. It can create a repeating launchd job and put Codex into a quit/patch/reopen loop. - Prefer this flow instead:
- prepare the patch script
- dry-run on a copied DB snapshot
- ask me to quit Codex manually
- run the live patch once
- ask me to reopen Codex manually
- If you do use launchd anyway, use a non-keepalive one-shot job and immediately remove it after the first run with:
launchctl remove <label>Then verify:launchctl print gui/$(id -u)/<label>should fail with “Could not find service”. - After restart, verify the gate reads as already enabled in the patched cache and tell me to check Settings > Appearance > Pets.
Do not patch /Applications/Codex.app/Contents/Resources/app.asar.
Do not modify Electron signatures or app integrity.
Do not force-kill Codex unless I explicitly approve it.