feat(codex): hydrate account models from chatgpt backend#4913
Conversation
|
This PR was auto-closed. Only contributors approved with Maintainers review auto-closed issues daily. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply. If a maintainer replies See CONTRIBUTING.md. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0ce0472b90
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| this.hydrationPromise = (async () => { | ||
| let hydrated = this.baseModels; |
There was a problem hiding this comment.
Preserve dynamically registered providers during hydration
hydrateAvailableModels() rebuilds from this.baseModels, which is only set in loadModels() and does not include models later added via registerProvider(). After any extension/runtime provider registration, a hydration call will overwrite this.models with that stale base list and drop the dynamically registered provider models. This regression is user-visible now that hydration is invoked in startup/session flows, so extension-provided models can disappear from selection and resolution.
Useful? React with 👍 / 👎.
| return cached.models; | ||
| } | ||
|
|
||
| const response = await fetch(OPENAI_CODEX_MODELS_URL, { |
There was a problem hiding this comment.
Add a timeout to catalog fetch used in model hydration
The account catalog request is awaited without an abort signal or timeout, and hydration is now called on critical paths (startup/session/model resolution). If chatgpt.com/backend-api/codex/models stalls at the TCP/HTTP layer, the CLI can block for an extended network timeout before falling back, despite hydration being treated as best-effort. Adding a bounded timeout (for example via AbortSignal.timeout(...)) avoids long startup hangs.
Useful? React with 👍 / 👎.
Summary
Testing
Notes
PI_OPENAI_CODEX_CLIENT_VERSIONoverride for backend-gated model version negotiationpackages/coding-agentbuild as the merge base had unrelated workspace/type-resolution issues outside this patch