Repository navigation
feat(codex): opt-in setting to use your default ~/.codex config directory - #5594
eilon-onyx wants to merge 1 commit into
Conversation
|
Ready to review this PR? Stage has broken it down into 5 individual chapters for you: Chapters generated by Stage for commit e581a8d on Jun 17, 2026 1:58pm UTC. |
📝 WalkthroughWalkthroughA new optional boolean field 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0642931d-3ba1-4e6f-b2d6-b6084a30f861
📒 Files selected for processing (12)
src/main/agent-hooks/managed-agent-hook-controls.tssrc/main/ipc/pty.test.tssrc/main/ipc/pty.tssrc/renderer/src/components/settings/AccountsPane.tsxsrc/renderer/src/components/settings/accounts-search.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/shared/constants.tssrc/shared/types.ts
| "d8a4c0e369": "Authenticate before creating a {{value0}}.", | ||
| "e9b5d1f470": "Check out a branch before creating a {{value0}}.", | ||
| "f0c6e2a581": "This branch is not ready for a {{value0}} yet.", | ||
| "h3i4j5k607": "Checking whether this branch can create a {{value0}}…" |
There was a problem hiding this comment.
Malformed localization key breaks catalog consistency
Line 8730 uses h3i4j5k607, which is not a valid SHA1-style hex key and is likely to miss lookups/parity against other locale catalogs. Replace it with the exact generated key from the source catalog sync output.
Based on learnings, locale keys here are auto-keyed from SHA1(file path + source text) and should stay catalog-parity aligned across locales.
Source: Learnings
| "d8a4c0e369": "Authenticate before creating a {{value0}}.", | ||
| "e9b5d1f470": "Check out a branch before creating a {{value0}}.", | ||
| "f0c6e2a581": "This branch is not ready for a {{value0}} yet.", | ||
| "h3i4j5k607": "Checking whether this branch can create a {{value0}}…" |
There was a problem hiding this comment.
Fix non-catalog key format for the new i18n entry.
"h3i4j5k607" does not match your catalog key convention and can break locale parity/sync for this string. Regenerate this key via the localization sync flow so it uses the standard SHA1-derived format.
Based on learnings, locale entries under src/renderer/src/i18n/locales/ should be auto-keyed using SHA1(file path + source text) and synced via pnpm run sync:localization-catalog.
Source: Learnings
| "d8a4c0e369": "Authenticate before creating a {{value0}}.", | ||
| "e9b5d1f470": "Check out a branch before creating a {{value0}}.", | ||
| "f0c6e2a581": "This branch is not ready for a {{value0}} yet.", | ||
| "h3i4j5k607": "Checking whether this branch can create a {{value0}}…" |
There was a problem hiding this comment.
Malformed localization key breaks catalog-key convention
Line 8730 uses "h3i4j5k607", which is not a valid SHA1-style hex key pattern used by this repo’s localization catalog. Please regenerate/sync this entry so the key matches the auto-key format and stays in parity with other locale files.
Based on learnings: “new strings should be auto-keyed using SHA1(file path + source text)… and catalog parity is maintained via pnpm run sync:localization-catalog.”
Source: Learnings
| "c72e5e65d1": "准备此分支并创建 {{value0}}", | ||
| "b8e4f2a901": "Wait for the remote operation to finish.", | ||
| "c9f3a1b802": "Resolve conflicts before creating a {{value0}}.", | ||
| "d2a8c4e703": "No changes on this branch to include in a {{value0}}.", | ||
| "e3b9d5f814": "Cannot create a {{value0}} from the default branch.", | ||
| "f4c0e6a925": "Commit changes before creating a {{value0}}.", | ||
| "a5d1f7b036": "Publish commits before creating a {{value0}}.", | ||
| "b6e2a8c147": "Push commits before creating a {{value0}}.", | ||
| "c7f3b9d258": "Sync this branch before creating a {{value0}}.", | ||
| "d8a4c0e369": "Authenticate before creating a {{value0}}.", | ||
| "e9b5d1f470": "Check out a branch before creating a {{value0}}.", | ||
| "f0c6e2a581": "This branch is not ready for a {{value0}} yet.", | ||
| "h3i4j5k607": "Checking whether this branch can create a {{value0}}…" |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's check if the file exists and read the relevant section
head -n 8730 src/renderer/src/i18n/locales/zh.json | tail -n 50Repository: stablyai/orca
Length of output: 2717
🏁 Script executed:
# Let's check the overall structure of keys in the file
head -n 100 src/renderer/src/i18n/locales/zh.json | tail -n 30Repository: stablyai/orca
Length of output: 1146
🏁 Script executed:
# Search for the specific key mentioned
rg "h3i4j5k607" src/renderer/src/i18n/locales/zh.json -A 2 -B 2Repository: stablyai/orca
Length of output: 345
🏁 Script executed:
# Search for localization sync tooling or documentation
find . -type f \( -name "*.json" -o -name "*.md" -o -name "*.ts" -o -name "*.js" \) | xargs rg -l "SHA1|sha1|localization.*sync|i18n.*sync" --max-count=20Repository: stablyai/orca
Length of output: 227
🏁 Script executed:
# Check if there's any script or tooling related to i18n/locale generation
find . -type f \( -name "*i18n*" -o -name "*locale*" -o -name "*translation*" \) | grep -E "\.(js|ts|py|sh)$" | head -20Repository: stablyai/orca
Length of output: 175
🏁 Script executed:
# Look for pattern validation or hash generation in the codebase
rg "h3i4j5k607|auto.*key|generate.*key" --type ts --type jsRepository: stablyai/orca
Length of output: 22441
🏁 Script executed:
# Check the TypeScript file that references h3i4j5k607
cat -n src/renderer/src/components/right-sidebar/source-control-primary-create-pr-intent-action.ts | grep -A 5 -B 5 "h3i4j5k607"Repository: stablyai/orca
Length of output: 489
🏁 Script executed:
# Look for localization key generation or validation logic
rg "SHA1|sha1|hash|keygen" src/main/i18n/ src/shared/ui-locale.ts --type ts -A 3 -B 3Repository: stablyai/orca
Length of output: 39
🏁 Script executed:
# Check if there's documentation about i18n keys or patterns
find . -type f \( -name "*.md" \) -exec rg -l "i18n|locale|SHA1.*key|auto.*key" {} \; | head -10Repository: stablyai/orca
Length of output: 121
🏁 Script executed:
# Check the localization audit documentation
cat ./config/localization-audit.mdRepository: stablyai/orca
Length of output: 4075
🏁 Script executed:
# Search for how the localization keys are supposed to be generated
rg "auto\." src/renderer/src/i18n/locales/zh.json | head -5Repository: stablyai/orca
Length of output: 39
🏁 Script executed:
# Look for the pattern of how keys are structured in actual code
rg "translate\(" src/renderer/src/components/right-sidebar/source-control-primary-create-pr-intent-action.ts -B 1 -A 2 | head -30Repository: stablyai/orca
Length of output: 1204
🏁 Script executed:
# Verify the SHA1 pattern by checking what a properly generated key might be
# Let's examine the localization sync script to understand key generation
find . -type f -name "*audit*" -o -name "*sync*" -o -name "*localization*" | grep -E "\.(js|mjs|ts)$" | head -10Repository: stablyai/orca
Length of output: 576
🏁 Script executed:
# Check the actual sync script to understand key generation
cat config/scripts/audit-localization-coverage.mjs 2>/dev/null | head -100Repository: stablyai/orca
Length of output: 2305
🏁 Script executed:
# Look at the verify-localization-catalog script to understand key generation
head -150 config/scripts/verify-localization-catalog.mjsRepository: stablyai/orca
Length of output: 4349
🏁 Script executed:
# Search for references to crypto/hash generation in localization scripts
rg "crypto|hash|SHA|md5|createHash" config/scripts/ --type js --type mjs -A 2 -B 2Repository: stablyai/orca
Length of output: 85
🏁 Script executed:
# Check if h3i4j5k607 appears anywhere else in the codebase
rg "h3i4j5k607" --type ts --type tsx --type js --type jsonRepository: stablyai/orca
Length of output: 85
🏁 Script executed:
# Search for the key generation logic more broadly
rg "createHash|crypto" config/scripts/ -A 5Repository: stablyai/orca
Length of output: 3118
🏁 Script executed:
# Look for SHA1 or hash patterns in the verify script with simpler approach
cat config/scripts/verify-localization-catalog.mjs | grep -A 10 -B 10 "hash\|crypto\|sha" | head -50Repository: stablyai/orca
Length of output: 39
🏁 Script executed:
# Check if there's a catalog sync script that might regenerate keys
cat config/scripts/sync-localization-catalog.mjs 2>/dev/null || echo "File not found, searching for similar..."Repository: stablyai/orca
Length of output: 98
🏁 Script executed:
# List all scripts in config/scripts
ls -la config/scripts/Repository: stablyai/orca
Length of output: 7588
🏁 Script executed:
# Perfect! Let's examine the localize-renderer-strings.mjs to confirm the exact pattern
cat config/scripts/localize-renderer-strings.mjs | head -100Repository: stablyai/orca
Length of output: 3076
🏁 Script executed:
# Now let's generate what the correct key should be for that source text
node -e "const crypto = require('crypto'); const source = 'Checking whether this branch can create a {{value0}}…'; const hash = crypto.createHash('sha1').update(source).digest('hex').slice(0, 10); console.log('Correct key would be: auto.components.right.sidebar.source.control.primary.action.' + hash);"Repository: stablyai/orca
Length of output: 150
Regenerate the localization key with correct SHA1 hash.
The key h3i4j5k607 contains non-hexadecimal characters (h, i, j, k) and doesn't match the SHA1 pattern used throughout the catalog. The correct key should be auto.components.right.sidebar.source.control.primary.action.77a3a268f7. Update this in both the locale file and the reference in src/renderer/src/components/right-sidebar/source-control-primary-create-pr-intent-action.ts, then rerun the localization catalog sync to ensure consistency.
Source: Learnings
|
Thanks for the contribution — the underlying change is already implemented in |
What & why
Codex launched inside Orca always runs against a managed runtime home — Orca injects
CODEX_HOME→~/Library/Application Support/orca/codex-runtime-home/home, a materialized copy of your config with its own auth/sessions/history. This means Codex doesn't read your real~/.codex/config.toml; edits to your system config aren't picked up, and history/sessions live somewhere else.This adds an opt-in setting (default off) — Settings → Accounts → "Use default Codex config directory" — that makes Codex use its native
~/.codexby injecting noCODEX_HOMEat all.Behavior
skipCodexHomeEnvis forced at all three PTY spawn sites, sobuildPtyHostEnvdeletesCODEX_HOME/ORCA_CODEX_HOMEand strips any ambient values, leaving Codex to resolve its own~/.codex.Design decisions
agentStatusHooksEnabledis off; Codex is the one agent whose home is always managed (even with zero managed accounts), so this setting is scoped to Codex alone.CODEX_HOME/ORCA_CODEX_HOMEinherited from the parent process, so a stale value can't leak into the child PTY (the test asserts this).Tests
Two unit tests in
src/main/ipc/pty.test.ts(spawn-env):CODEX_HOME/ORCA_CODEX_HOMEeven when a managed home is selected and ambient values are present — this only holds because of the new OR, so it catches a regression.Cross-platform / SSH / agent notes
buildPtyHostEnv, so local, daemon-backed, and SSH/remote Codex spawns all honor the setting identically — no separate wiring.translate()with catalog parity viapnpm sync:localization-catalog.Checks
pnpm exec oxlint— clean on changed filespnpm typecheck— cleanpnpm test— full suite passes (17,479 passed / 15 skipped)pnpm buildlocally; change is renderer/main TS + localized strings only.)AI code-review summary
Reviewed for: cross-platform (single shared env path; no platform-specific assumptions added) ✓ · SSH/remote/local (all route through
buildPtyHostEnv) ✓ · agent compatibility (scoped to Codex; opencode/pi/claude untouched) ✓ · performance (one boolean settings read at spawn time; no hot-path work) ✓ · UI quality (reusesSettingsSwitchRowinsideSearchableSetting, matchingMobileEmulatorSettingsPane) ✓ · security (no new surface; the on-path only removes an env injection) ✓.Screenshots
No screenshot attached yet — it's a standard
SettingsSwitchRowin the existing Accounts pane (same primitive as its neighbours). Happy to add one on request.ELI5
Codex in Orca usually uses a managed copy of config, so your real ~/.codex is ignored. An opt-in setting lets Codex use your default ~/.codex directory instead, so your real config and history apply.