Skip to content

feat(openai): add GPT-6.1 Terra support - #2379

Open
bigyao25 wants to merge 1 commit into
Zoo-Code-Org:mainfrom
bigyao25:feat/gpt-6.1-terra
Open

bigyao25 wants to merge 1 commit into
Zoo-Code-Org:mainfrom
bigyao25:feat/gpt-6.1-terra

Conversation

@bigyao25

@bigyao25 bigyao25 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #2380

The issue is linked. Maintainer approval and assignment are pending. The author has requested review and will coordinate with the core team.

Description

This PR adds GPT-6.1 Terra to the native OpenAI and ChatGPT subscription Codex catalogs. It does not change the existing provider defaults.

The native catalog uses the official 1,050,000-token context window and 128,000-token output limit. It supports image input, prompt caching, verbosity, and none through max reasoning effort. It includes Standard, Flex, Priority, and long-context pricing from the official OpenAI documentation.

The Codex catalog uses the supported 872,000-token maximum context window. It uses low reasoning by default and routes tool requests through Responses Lite. A separate Terra request suite covers native and Codex behavior. The existing GPT-6.1 Sol test file is unchanged.

This change supports the roadmap goal to support more AI providers and models.

Sources:

Test Procedure

Run these commands from the repository root:

pnpm --dir packages/types exec vitest run src/__tests__/openai-models.test.ts
pnpm --dir src exec vitest run api/providers/__tests__/openai-sol-6.1.spec.ts api/providers/__tests__/openai-terra-6.1.spec.ts
pnpm run check-types
pnpm knip
pnpm knip:production
pnpm test:knip-policy

Results:

  • 30 focused tests passed.
  • All 12 workspace type-check tasks passed.
  • Both Knip checks passed.
  • All 8 Knip policy tests passed.
  • Commit lint and formatting hooks passed.

The tests ran on macOS with Node 24.22.1 and pnpm 10.8.1. The repository declares Node 22.23.4. The engine mismatch produced a warning only.

Live paid API requests were not run.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I reviewed my own code with care.
  • Writing Style: The PR title and description use Simplified Technical English (ASD-STE100): short sentences, plain words, active voice, one idea per sentence, no contractions.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Test Helpers (test changes only): Shared test helpers (src/test-utils/, @/utils/test-utils) are used only for mechanical duplication; test intent and scenario-specific mocks remain visible.
  • Visual Snapshot (UI changes only): This PR has no UI changes.
  • Documentation Impact: I checked if my changes need documentation updates (see "Documentation Updates" section below).
  • Contribution Guidelines: I read and agree to the Contributor Guidelines.

Visual Snapshots

Not applicable. This PR has no UI changes.

Videos (interaction / animation only)

Not applicable. This PR has no interaction or animation changes.

Documentation Updates

  • No documentation updates are required. The existing model picker reads the shared catalogs.
  • Yes, documentation updates are required.

Additional Notes

AI tools assisted with implementation and test preparation. The author reviewed the model metadata against the official sources and ran the checks listed above.

Issue #2380 is linked. Maintainer approval and assignment are pending.

Get in Touch

The author will provide a Discord contact in the PR thread if the maintainers need it.

Add GPT-6.1 Terra to the native OpenAI and subscription-based Codex catalogs without changing provider defaults.

Configure official context and output limits, provider-specific reasoning efforts, image input, prompt caching, Standard/Flex/Priority pricing, and long-context multipliers. Route Codex requests through Responses Lite.

Add dedicated Terra request tests for reasoning selection, native tool requests, priority pricing, and Codex Fast-mode headers and tool shaping. Preserve the existing Sol test file unchanged.
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • New Features
    • Added support for GPT-6.1 Terra in OpenAI and Codex. The model supports image inputs, prompt caching, and configurable reasoning, with a context window of up to 1,050,000 tokens in OpenAI and 872,000 tokens in Codex.
    • Codex requests for GPT-6.1 Terra now use the Responses Lite format.

GPT-6.1 Terra is added to the native OpenAI and Codex model catalogs. The Codex provider routes it through Responses Lite. Tests cover model metadata, reasoning-effort mappings, pricing, and native and Codex request fields.

Changes: GPT-6.1 Terra support

Layer / File(s) Summary
Add Terra model metadata
packages/types/src/providers/openai.ts, packages/types/src/providers/openai-codex.ts, packages/types/src/__tests__/openai-models.test.ts
The native and Codex catalogs define GPT-6.1 Terra with separate context limits, reasoning settings, capabilities, tools, and pricing. Tests check the metadata and confirm that default model IDs remain unchanged.
Route and shape Terra requests
src/api/providers/openai-codex.ts, src/api/providers/__tests__/openai-terra-6.1.spec.ts
The Codex provider routes GPT-6.1 Terra through Responses Lite. Tests check reasoning-effort mappings, native request fields and pricing, and Codex request shaping.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Possibly related PRs

  • Zoo-Code-Org/Zoo-Code#2260: Updates GPT-6-class cache-write pricing in the shared OpenAI catalog and model tests, which are also changed here.
Merge Risk: Minimal · up to 79fcb

Terra support adds model metadata and subscription routing without changing provider defaults. No concrete merge-blocking issue is established by the available evidence.

Pre-merge checks: Passed 8

Check name Status Explanation
Title check Passed The title "feat(openai): add GPT-6.1 Terra support" names the main change: adding the GPT-6.1 Terra model to the OpenAI native and Codex catalogs. It is short, specific, and matches the changeset and …
Description check Passed The description follows the repository template. It links issue #2380 under Related GitHub Issue and includes Description, Test Procedure, Pre-Submission Checklist, Visual Snapshots, Videos, Documenta…
Linked Issues check Passed Issue #2380 is the only active direct link. Its coding requirements are met at head 79fcb4a, as checked against the diff from merge base e487cd7.

Native OpenAI catalog (packages/types/src/providers…
Out of Scope Changes check Passed All changed files relate to the GPT-6.1 Terra objective of #2380. The changes are:
- packages/types/src/providers/openai.ts: native catalog entry.
- packages/types/src/providers/openai-codex.ts: Codex…
Regression Evidence Passed The new tests cover Terra metadata, reasoning defaults and invalid settings, native request pricing, and Codex Responses Lite routing. Existing Responses Lite tests cover transformation errors and uns…
Security Boundaries Passed The changed paths add model metadata, tests, and existing Responses Lite routing. Tool calls still pass through policy validation and approval controls. No concrete security boundary failure was ident…
Persistence Integrity Passed The changes add model metadata, request routing, and tests. They do not change a persistence path or persisted default.
Lifecycle Resource Cleanup Passed The production changes add model metadata and route Terra requests through the existing Responses Lite path. The changed code does not introduce a lifecycle resource leak or duplicate work after cance…
Full details: Title check

Explanation

The title "feat(openai): add GPT-6.1 Terra support" names the main change: adding the GPT-6.1 Terra model to the OpenAI native and Codex catalogs. It is short, specific, and matches the changeset and the linked issue #2380. It does not cover every detail, which is expected.

Full details: Description check

Explanation

The description follows the repository template. It links issue #2380 under Related GitHub Issue and includes Description, Test Procedure, Pre-Submission Checklist, Visual Snapshots, Videos, Documentation Updates, Additional Notes, and Get in Touch sections. It explains the native and Codex catalog changes, the tests, and the verification results. Minor gaps: the issue link is not confirmed as approved (approval is pending), the Get in Touch section gives no Discord username yet, and the checklist's Issue Linked item is unchecked while the other items are checked. The description also includes a roadmap statement that is not technical detail. The Test Procedure references openai-sol-6.1.spec.ts, which the changeset summary does not list as a changed file, so the reviewer should confirm that file exists.

Full details: Linked Issues check

Explanation

Issue #2380 is the only active direct link. Its coding requirements are met at head 79fcb4a, as checked against the diff from merge base e487cd7.

Native OpenAI catalog (packages/types/src/providers/openai.ts, gpt-6.1-terra):

  • Context window 1,050,000 and maxTokens 128,000.
  • supportsImages and supportsPromptCache set to true.
  • supportsReasoningEffort covers none, low, medium, high, xhigh, and max. Default is medium.
  • Standard pricing (input 1, output 5, cache reads 0.05, cache writes 1.25 and 2.5 for 12h).
  • Flex tier and priority tier pricing.
  • longContextPricing with threshold 272,000 and multipliers for default, flex, and priority.
  • Default model IDs remain gpt-5.6-sol.

Codex catalog (packages/types/src/providers/openai-codex.ts, gpt-6.1-terra):

  • contextWindow 872,000 and maxTokens 128,000.
  • reasoningEffort default low, with requiredReasoningEffort true.
  • supportsTemperature false. Costs are zero, as the issue expects for subscription use.
  • openAiCodexDefaultModelId remains gpt-5.6-sol.

Responses Lite routing (src/api/providers/openai-codex.ts): gpt-6.1-terra is added to RESPONSES_LITE_MODEL_IDS.

Tests:

  • src/api/providers/tests/openai-terra-6.1.spec.ts covers reasoning-effort selection for native and Codex (issue: reasoning selection). It covers native Responses request construction with max_output_tokens, reasoning, service_tier, and tools, and no temperature (issue: native tool requests). It covers priority service-tier pricing (issue: service-tier pricing). It covers Codex Responses Lite tool request shaping with the Responses Lite header, no instructions, tools, max_output_tokens, or temperature (issue: Codex tool request shaping).
  • The packages/types metadata test (openai-models.test.ts, per the change summary) covers model metadata, including flex pricing, which the spec file does not assert.

Non-coding items (manual steps, maintainer approval) are not assessed.

Full details: Out of Scope Changes check

Explanation

All changed files relate to the GPT-6.1 Terra objective of #2380. The changes are:

  • packages/types/src/providers/openai.ts: native catalog entry.
  • packages/types/src/providers/openai-codex.ts: Codex catalog entry.
  • src/api/providers/openai-codex.ts: one-line addition of gpt-6.1-terra to RESPONSES_LITE_MODEL_IDS. The rest of the diff is formatting of the same Set literal.
  • packages/types/src/tests/openai-models.test.ts: metadata tests for Terra.
  • src/api/providers/tests/openai-terra-6.1.spec.ts: Terra request tests.

The PR does not change default models, the existing GPT-6.1 Sol test file, or other provider behavior. No unrelated change was found in the reviewed diffs. The packages/types test file was not diffed directly; its contents are taken from the change summary.

Full details: Regression Evidence

Explanation

The new tests cover Terra metadata, reasoning defaults and invalid settings, native request pricing, and Codex Responses Lite routing. Existing Responses Lite tests cover transformation errors and unset inputs. The PR does not change UI components.

Full details: Security Boundaries

Explanation

The changed paths add model metadata, tests, and existing Responses Lite routing. Tool calls still pass through policy validation and approval controls. No concrete security boundary failure was identified.

Full details: Lifecycle Resource Cleanup

Explanation

The production changes add model metadata and route Terra requests through the existing Responses Lite path. The changed code does not introduce a lifecycle resource leak or duplicate work after cancellation, disposal, or restart.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e487cd7 and 79fcb4a.

Files selected for processing: 5

  • packages/types/src/__tests__/openai-models.test.ts
  • packages/types/src/providers/openai-codex.ts
  • packages/types/src/providers/openai.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts
  • src/api/providers/openai-codex.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Recent review details

Context from checks skipped due to timeout: 3

  • GitHub Check: CodeRabbit
  • GitHub Check: mutation-diff
  • GitHub Check: extension-host-visual
Additional context used

Path-based instructions: 6

Treat model, provider, MCP, path, command, and tool data as untrusted.

CodeRabbit configuration file

Files:

  • src/api/providers/openai-codex.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts
For persisted settings, verify the complete schema/storage/runtime/webview round trip, shared default semantics, and focused true plus false/unset tests.

CodeRabbit configuration file

Files:

  • packages/types/src/providers/openai-codex.ts
  • packages/types/src/providers/openai.ts
  • packages/types/src/__tests__/openai-models.test.ts
Require regression coverage at the lowest valid harness with behavior-focused assertions, including relevant negative, error, false/unset, and boundary cases.

CodeRabbit configuration file

Files:

  • packages/types/src/__tests__/openai-models.test.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.

CodeRabbit configuration file

Files:

  • packages/types/src/providers/openai-codex.ts
  • packages/types/src/providers/openai.ts
  • src/api/providers/openai-codex.ts
  • packages/types/src/__tests__/openai-models.test.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.

CodeRabbit configuration file

Files:

  • src/api/providers/openai-codex.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts
Act as an adversarial second-opinion reviewer.

CodeRabbit configuration file

Files:

  • packages/types/src/providers/openai-codex.ts
  • packages/types/src/providers/openai.ts
  • src/api/providers/openai-codex.ts
  • packages/types/src/__tests__/openai-models.test.ts
  • src/api/providers/__tests__/openai-terra-6.1.spec.ts

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Review status

Thanks for contributing. This comment tracks the review sequence and the next action.

Current step: Awaiting fresh human maintainer or CODEOWNER approval.

Automated review is complete for the latest commit but does not replace human approval.

Review-state labels are managed by this workflow; do not edit them manually. community-approved is managed the same way — do not add or remove it manually. It signals a fresh community code approval for the current head as an advisory priority only; maintainer review is still required.

@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@bigyao25
bigyao25 marked this pull request as ready for review November 9, 2026 08:13
@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Nov 9, 2026
@github-actions github-actions Bot added awaiting-maintainer CodeRabbit approved; waiting for a human maintainer and removed coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit labels Nov 9, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-maintainer CodeRabbit approved; waiting for a human maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GPT-6.1 Terra support

1 participant