feat(codex): converge account picker catalogs - #1212
Conversation
|
✅ Deterministic PR hygiene checks passed. |
✅ READY
Review readiness checklist
✅ 4/4 boxes ticked. This pull request is already Ready for Review. Hygiene✅ Deterministic PR hygiene checks passed. |
📝 WalkthroughWalkthroughThe PR adds account-picker gating, separates catalog metadata from runtime support, records provider discovery authority, rewrites catalog merging around explicit observed state, and adds custom-model ownership migration. It also adds broad tests for convergence, restoration, collisions, provider degradation, and configuration persistence. ChangesCodex catalog convergence
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)sequenceDiagram
participant Convergence
participant CatalogSource
participant ProviderFetch
participant ObservedMerge
participant ConfigPersistence
Convergence->>CatalogSource: Resolve catalog kind and runtime support
Convergence->>ProviderFetch: Gather models and provider outcomes
ProviderFetch-->>Convergence: Return models with authoritative or degraded states
Convergence->>ObservedMerge: Build and merge observed catalog state
ObservedMerge-->>Convergence: Return normalized catalog entries
ConfigPersistence->>ConfigPersistence: Project and adopt migration metadata
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a4878de383
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
|
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/codex-convergence-account-selectors.test.ts`:
- Around line 512-514: Update the convergence assertion around syncCatalogModels
so unchanged custom-catalog.json content expects catalogWritten to be false, or
adjust writeRetainedCatalogSync to skip replaceActiveCodexCatalog and its atomic
write when prepared bytes match the existing file; preserve true only when
content is physically written.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: cbffb3b0-0bdf-4bf6-a7cd-92fc452c48b1
📒 Files selected for processing (5)
src/codex/catalog/bundled.tssrc/codex/catalog/sync.tstests/codex-catalog.test.tstests/codex-convergence-account-selectors.test.tstests/codex-runtime.test.ts
Review - Request ChangesRequesting changes for one correctness issue I found. P2 - Legacy custom models can ignore deletion during an outage after upgradingThere is a migration edge case around the new Custom model rows created by older OpenCodex versions do not have this marker. In the new merge logic, an absent custom row is treated as an intentional deletion only when the existing catalog row already carries That means this sequence can leave a deleted model behind:
The result is that a model the user explicitly deleted can remain in the Codex catalog until a later authoritative provider refresh. I think this needs either an ownership migration for legacy custom rows or another mechanism that lets config deletion remain authoritative during the first post-upgrade degraded refresh. Please also add a regression covering:
Apart from this, I did not find another merge-blocking correctness or security issue in the current diff. I also did not find a new credential/account-identity leak. CI noteThe current GitHub Actions run for |
…g-convergence # Conflicts: # src/codex/catalog/sync.ts # tests/codex-catalog.test.ts
|
✅ Action performedReview finished.
|
|
The first relevant config write now records a one-time ownership ledger from the persisted pre-upgrade The classification is deliberately narrow: foreign rows, account-selector rows, combo rows, and unknown future markers are preserved. If authoritative provider discovery later returns the same slug, it is marked as an ordinary provider row so a later outage cannot remove it using stale migration evidence. I added the requested end-to-end regressions for both writers (old unmarked row, config removal, degraded discovery), including preservation of an unrelated degraded sibling. The migration/save-boundary and fail-closed cases are covered separately. The focused catalog/config/convergence run is 429 passing tests; typecheck, privacy scan, and diff check also pass. |
Summary
multi_agent_v2from the admitted config bytesThis is the third slice requested in #1019, following #1096 and #1152. It intentionally contains catalog construction, merge, and convergence behavior only. Management API/dashboard activation and the remaining lifecycle work stay in later slices.
Part of #425.
Verification
dev@fdc47db7bun run typecheckbun run privacy:scangit diff --checkChecklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit
New Features
codexAccountPickerEnabledsetting for account-qualified Codex model rows.Bug Fixes
Documentation