Repository navigation
fix(server): partitioned Codex models_cache files no longer break shadow homes - #45450
DOISolutions wants to merge 3 commits into
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Partitioned Codex model caches now remain private to configured shadow homes, with stale cache symlinks removed during setup. Real cache files, shared targets, and existing authentication safeguards are preserved. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…-partitioned-models-cache
…ntry names Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Codex shadow-home provider instance fails to initialize and gets disabled when Codex writes an originator-partitioned models cache file (
models_cache.<originator>.json, such asmodels_cache.codex_work_desktop.json) to both the shadow home and the shared home:Cause
Upstream Codex partitions disk model caches by originator via
FileModelsCache::for_originator(codex-rs/models-manager/src/cache.rs) usingModelCatalogOriginator(codex-rs/models-manager/src/originator.rs), writingmodels_cache.<originator>.jsonalongsidemodels_cache.json. Each file is scoped to the account's auth identity, so sharing it across shadow homes causes identity mismatches and breaks setup if the shadow home creates the file before the shared home does.CodexHomeLayout.tsonly treated the literalmodels_cache.jsonas private.Fix
models_cache.<originator>.json(/^models_cache\.[^.]+\.json$/) as private alongsidePRIVATE_ENTRY_NAMESinapps/server/src/provider/Drivers/CodexHomeLayout.ts.auth.jsonfail-closed.apps/server/src/provider/Drivers/CodexHomeLayout.test.tscovering real files in both homes, removal of legacy symlinks, non-linking of shared-only partitioned caches, and idempotent re-materialization.Verification
0.1.13with two Codex shadow homes (codex-cli 0.166.0). Codex created~/.codex-personal2/models_cache.codex_work_desktop.jsonone second before~/.codex/models_cache.codex_work_desktop.json; on restart,codex_personal2failed withCodexShadowHomeEntryConflictErrorand showed as disabled until the duplicate cache file was removed.bun build --no-bundle,git diff --check, and tested the regex against all 9ModelCatalogOriginatorvalues plus negative cases.lint,typecheck,test_server) because the local machine did not have enough free disk space for a full monorepopnpminstall.Generated with Gemini 4 Neon.