feat(codex): add account-qualified catalog entries - #949
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe change adds account-qualified native Codex models. It filters selectors, generates and reconciles account-bound catalog rows, updates discovery and parsing, applies provider-aware visibility, and scopes multi-agent guidance by account namespace. ChangesAccount-bound native catalog
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Client
participant ModelDiscovery
participant CatalogSync
participant CatalogStore
participant MultiAgentGuidance
Client->>ModelDiscovery: Request model listings
ModelDiscovery->>CatalogSync: Provide provider state and account selectors
CatalogSync->>CatalogStore: Generate and reconcile account-bound rows
CatalogStore-->>ModelDiscovery: Return visible catalog entries
ModelDiscovery-->>Client: Return Codex and OpenAI model listings
Client->>MultiAgentGuidance: Request guidance with account namespace
MultiAgentGuidance-->>Client: Return namespace-filtered model guidance
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
2bf0a71 to
f9bbc72
Compare
f9bbc72 to
2b84389
Compare
2b84389 to
0f24517
Compare
2308180 to
18aedec
Compare
18aedec to
1d737c2
Compare
1d737c2 to
c6c9e7e
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
c6c9e7e to
c2132f0
Compare
a0d0957 to
bf7b132
Compare
bf7b132 to
72ed0ed
Compare
72ed0ed to
3d67eb2
Compare
93c8284 to
a88b3c7
Compare
a88b3c7 to
7f82a4d
Compare
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo '=== PR metadata and checks ==='
gh pr view 949 --repo lidge-jun/opencodex \
--json url,headRefOid,baseRefOid,isDraft,mergeStateStatus,statusCheckRollup \
--jq '{url,headRefOid,baseRefOid,isDraft,mergeStateStatus,checks:[.statusCheckRollup[] | {name,status,conclusion}]}'
echo
echo '=== Discovery implementation outline ==='
ast-grep outline src/server/index.ts --items all --type function --match 'models|catalog' || true
echo
echo '=== Bare and qualified native discovery sources ==='
rg -n -C 8 'visibleNatives|visibleNativeSlugs|NATIVE_OPENAI_MODELS|accountSelectors|selectorNativeSlugs' \
src/server/index.ts
echo
echo '=== Discovery regression assertions ==='
rg -n -C 5 'plainIds|gpt-5\.5|NATIVE_OPENAI_MODELS|selector' \
tests/claude-models-discovery.test.tsLength of output: 13389
The regression assertion remains valid. The test setup at Lines 172-188 also disables I withdraw the finding that plain ✏️ Learnings added
You are interacting with an AI system. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7f82a4ded4
ℹ️ 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".
| function isRoutableFallbackModel(model: string, config: OcxConfig): boolean { | ||
| const slash = model.indexOf("/"); | ||
| if (slash > 0) { | ||
| if (codexAccountNamespaceForModel(config.codexAccountNamespaces, model)) return true; |
There was a problem hiding this comment.
Preserve case-distinct account fallbacks
Once account-selector ids are admitted here, fallback chains still pass through normalizedChain(), which de-duplicates by trimmed.toLowerCase(). Account selectors are case-sensitive and can route to different accounts (for example work/gpt-5.5 and Work/gpt-5.5), so a chain containing both drops the second before availability checks; if the first account is paused/cooled down, the healthy case-distinct account is never tried. Keep the selector segment case-sensitive when de-duping account-qualified fallback ids.
Useful? React with 👍 / 👎.
Summary
dev; this layer adds the catalog, discovery, and subagent projection that make those selectors usable from model pickers./v1/modelsavailability. Missing stored-account targets are not advertised, and stored ids, aliases, and email addresses never enter public model metadata.disabledModelsconsistent: a bare native id hides that model for every selector, while an account-qualified id hides only the matching selector row.{{model}}is blank unless the request resolves a unique/current-route candidate, while explicit routed or account-qualified ids retain their existing raw fallback.Verification
33270c3f: TypeScript typecheck, privacy scan, andgit diff --checkpassed. The catalog restore, sync-hardening, and refresh suites passed with 31 tests and 162 assertions.33270c3f: the macOS-style symlinked-temp restore case passed 20 consecutive runs, and the catalog idempotency case passed 30 consecutive runs after moving its large intermediate snapshot out of child-process stdout.7f82a4de: the catalog/discovery/restore, exact-account routing, subagent fallback, native visibility, and upstream retry integration matrix passed with 483 passed, 2 platform-only skipped, 0 failed, and 5,936 assertions across 18 files.7f82a4de: Cross-platform CI passed all four Linux test shards, React Doctor, gates, keyring checks, and npm-global packaging on Linux, macOS, and Windows. The macOS suite reached 8,189 passed and 8 skipped; its only failure was the lexical/varversus canonical/private/vartest expectation corrected by the current head.devat7343f0ba;git range-diffconfirms the nine feature patches are unchanged, and every commit has a valid GPG signature.Checklist
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 fixed all correct Codex and CodeRabbit findings.
My PR is ready for review.