Skip to content

agentHost: fix context picker for ChatGPT Codex models - #335517

Merged
Giuseppe Cianci (Giuspepe) merged 3 commits into
mainfrom
agents/fix-chatgpt-codex-context-picker
Sep 10, 2026
Merged

agentHost: fix context picker for ChatGPT Codex models#335517
Giuseppe Cianci (Giuspepe) merged 3 commits into
mainfrom
agents/fix-chatgpt-codex-context-picker

Conversation

@Giuspepe

@Giuspepe Giuseppe Cianci (Giuspepe) commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • keep Codex app-server model/list authoritative for the ChatGPT models and reasoning levels available to the signed-in account
  • read default and maximum context limits from the same bundled Codex binary via its supported codex debug models JSON view, using the app-server environment and configuration
  • publish context-size choices for ChatGPT subscription models without requiring GitHub authentication, a Copilot subscription, or a matching Copilot catalog entry
  • refresh the selected model snapshot when an existing identifier is republished with enriched metadata
  • route the selected context window and thinking level to Codex for both Copilot and ChatGPT model providers

Testing

  • npm run compile
  • npm run hygiene
  • 199 targeted unit tests across Codex model refresh, prewarm/session routing, and chat model selection
  • git diff --check
  • live launch + DAP verification with GitHub authentication disabled and a ChatGPT Plus account:
    • zero Copilot models were present
    • GPT-5.6-Sol showed Low through Ultra thinking levels and 272K / 872K context choices
    • selecting 872K and High produced model_context_window: 872000 and thinkingLevel: high in the actual Codex app-server requests
  • live Copilot-provider verification remained intact for its independently sourced context and thinking options

Reuse the matching Copilot catalog context tiers for ChatGPT-backed Codex models and refresh selected model metadata when catalogs republish it. Cover both provider routes and verify that context window and reasoning effort reach app-server requests.
Copilot AI balanced review requested due to automatic review settings September 10, 2026 17:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The implementation is focused and well tested; the only finding is a non-blocking comment-concision cleanup.

Review tier: Balanced
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​vs/​workbench/​contrib/​chat/​browser/​widget/​input/​chatInputModelSelectionController.ts — This multi-line inline comment narrates the immediately following call. Condense it to a single…
What changed in this PR

Adds context-size selection for ChatGPT Codex models by enriching them with matching Copilot catalog metadata.

Changes:

  • Inherits context-size schemas for matching ChatGPT models.
  • Refreshes selected-model metadata after catalog enrichment.
  • Tests both Copilot and ChatGPT routing and configuration payloads.
File Description
codexAgent.ts Enriches ChatGPT models with Copilot context-size metadata.
codexModelRefresh.test.ts Tests context-size schema publication and removal.
codexPrewarmEviction.test.ts Tests provider-specific thread configuration.
chatInputModelSelectionController.ts Refreshes republished selected-model metadata.
chatInputModelSelectionController.test.ts Verifies metadata refresh without reapplying selection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Giuspepe Giuseppe Cianci (Giuspepe) changed the title agentHost: show context picker for ChatGPT Codex models agentHost: fix context picker for ChatGPT Codex models Sep 10, 2026
@Giuspepe Giuseppe Cianci (Giuspepe) changed the title agentHost: fix context picker for ChatGPT Codex models agentHost: fix context picker for ChatGPT subscription provided models Sep 10, 2026
Read context limits from the Codex binary's JSON model catalog while keeping app-server model/list authoritative for account-visible models. This removes the ChatGPT picker dependency on a matching Copilot catalog entry.
@Giuspepe Giuseppe Cianci (Giuspepe) changed the title agentHost: fix context picker for ChatGPT subscription provided models agentHost: fix context picker for ChatGPT Codex models Sep 10, 2026
@Giuspepe
Giuseppe Cianci (Giuspepe) marked this pull request as ready for review September 10, 2026 18:14
@Giuspepe
Giuseppe Cianci (Giuspepe) merged commit e796db3 into main Sep 10, 2026
33 checks passed
@Giuspepe
Giuseppe Cianci (Giuspepe) deleted the agents/fix-chatgpt-codex-context-picker branch September 10, 2026 18:47
@vs-code-engineering vs-code-engineering Bot added this to the 1.138.0 milestone Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants