Skip to content

🤖 fix: clamp GPT-6 Sol/Luna headless tool loops to reasoning none and correct their Codex context cap - #4259

Open
ThomasK33 wants to merge 1 commit into
gpt6-reasoning-none-followupfrom
gpt-6-sol-prep
Open

ThomasK33 wants to merge 1 commit into
gpt6-reasoning-none-followupfrom
gpt-6-sol-prep

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Sep 15, 2026

Copy link
Copy Markdown
Member

Summary

Stacked on #4350. That PR makes a requested reasoning_effort: "none" reach the wire for GPT-6 Sol/Luna. This PR closes the three gaps left after #4348 and #4350: headless tool loops that request no effort at all, Coder-scoped aliases on openai-compat instances, and the assumed 372K Codex OAuth context cap (272K in the pinned Codex catalog).

Background

Implementation

  • clampGpt6ChatCompletionsToolReasoning (providerModelFactory.ts): a transformParams middleware that sets reasoningEffort: "none" when the request carries tools and no effort was requested, for Sol/Luna capability identities on Chat Completions. Explicit caller efforts are preserved (this keeps 🤖 fix: send GPT-6 Sol/Luna reasoning effort none and repair main CI #4350's "requested high stays high" contract intact). It wraps outside createOpenAIModelWithPreservedOptions so the injected none is seen by that wrapper's body patch instead of being stripped by the SDK.
  • Applied on the direct OpenAI path (Chat Completions wire only) and the Coder gateway Chat path, where the capability identity is resolveModelForMetadata(coder:<instance>/<model>) so scoped "Treat as" aliases are clamped too.
  • CODEX_OAUTH_CONTEXT_WINDOW_OVERRIDES: gpt-6-sol / gpt-6-luna 372K → 272K with the pin cited inline; Astra and the GPT-5.6 family are unchanged (🤖 fix: reconcile GPT-5.6 Sol promotional pricing and Astra Codex context cap #4347).

Dropped from earlier revisions: catalog/aliases/pricing/labels/migration/docs (landed in #4348), the @ai-sdk/openai Bun patch (Bun patchedDependencies never reach npm installs of @coder/xum; #4350's runtime rewrite is the right fix), and the hasTools plumbing through buildProviderOptions.

Validation

Repo-pinned Bun 1.3.5, on this stacked tree (no SDK patch, so a green body assertion proves the wrapper composition).

  • providerModelFactory.test.ts › "clamps %s tool requests … at the model boundary" (Sol raw id, mapped team-luna, Astra control, Responses control) and › "clamps %s tool requests through a Coder openai-compat instance" (coder:chat-proxy/team-luna mapped, coder:chat-proxy/gpt-6-sol raw, team-astra control). Red proof: with the clamp disabled, exactly the four Sol/Luna Chat Completions cases fail (Expected "none" / Received undefined); 🤖 fix: send GPT-6 Sol/Luna reasoning effort none and repair main CI #4350's 11 wire cases are unaffected. Reverting the Coder capability argument to the raw originModelId fails exactly the mapped team-luna case.
  • codexOAuth.test.ts asserts Astra (372K) and Sol/Luna (272K) separately. contextLimit, tokenMeterUtils, thinking, turnRequestBuilder, providerOptions suites pass. make static-check green.

Risks

  • The middleware fires only for Sol/Luna capability identities, Chat Completions wire, a non-empty tools array, and no requested effort. Responses, tool-free requests, explicit efforts, Astra, GPT-5.6 and non-OpenAI providers are untouched.
  • Lower Codex OAuth cap (272K) starts limit-driven compaction earlier for OAuth-routed Sol/Luna; API-key routes keep the public limits.

Readiness and follow-ups

Preserved review and delivery record — fifteen Codex executions including this head, one code-advisor pass
Round Reviewed head (before rebase / re-scope) Executions Findings / disposition
1 01ca053 Codex code + security Hidden-model compaction exposure and zero pricing bypassing CLI budget; fixed in 252bba9 / cb5ac4b, replied and resolved
2 cb5ac4b Codex code + security Migration-marker flip and hiding prior opt-ins; fixed in 64169a3, replied and resolved
3 64169a3 Codex code + security Clean completion on both loops
4, renewed authorization 40e4b2a6 Automatic Codex code + security on undraft Security clean; code P2 Chat Completions default-effort issue → fixed in ce20ecd0, replied and resolved
5, explicit "get it merged" authorization bfc0906f (superseding ce20ecd0) Automatic Codex code review on undraft P2: headless tool loops bypass provider options → fixed in a4c7c156, replied and resolved
6 a4c7c156 Explicit @codex review (code + security) Code P2: Coder aliases not resolved before clamping → fixed, replied and resolved. Security P2: priority-tier budget accounting → pre-existing/generic, #4352, replied and resolved
7 2c4803c0 (residual on main after #4348) Explicit @codex review (code + security) Both clean ("Didn't find any major issues" / "No security issues")
8 c9a0f572 (stacked on #4350) Explicit @codex review (code + security) Both clean ("Didn't find any major issues" 21:57Z / "No security issues" 21:59Z, 👍)
Advisory One independent advisor Recommended scope reduction and accuracy fixes before official release. Scope reduction realised by #4348 and #4350 landing first; this PR is the residual.

Post-cap work, retained in order: f04892ffcf5d0f budget-comment accuracy; 782cca604bad77 maintainer-authorized provisional estimate; d24d776 rebase integration; 870259a official Sol launch + authorized Luna expansion; 40e4b2a6 verified Codex defaults, labels, route/pricing regressions, docs; ce20ecd0 tool-aware none clamp + SDK patch; bfc0906f Nix hash refresh; a4c7c156 model-boundary clamp; 2c4803c0 residual on main (SDK patch + clamp + Coder alias + Codex cap). Other rebase mappings: 01ca053c47ba9c, 252bba95363ca0, cb5ac4ba866d96, 64169a3c0d5def. The cap did not reset on rebase, handoff, scope expansion or re-scope. Backups of superseded heads: a4c7c15635f3a865baa4b937618da17459b48209, 2c4803c0c9481924ad682f969542a7a6db71e9e7.

Historical stop reason: implementation and validation were complete for both models, but the final head lacked review coverage under the exhausted cap. The later direct conditional merge instruction reopened delivery for one automatic final-head pair; its findings were then fixed under the user's explicit "get it merged" authorization through the normal gated merge path. When #4348 and then #4350 landed the same work first, this PR was reduced to the residual fixes above rather than closed.


Generated with xum • Model: coder:anthropic/claude-fable-5-1 • Thinking: xhigh • Cost: $174.60

@mintlify

mintlify Bot commented Sep 15, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
Mux 🟢 Ready View Preview Sep 22, 2026, 9:15 PM

💡 Tip: Enable Automations to automatically generate PRs for you.

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

This comment has been minimized.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 01ca0537be

ℹ️ 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".

Comment thread src/common/constants/knownModels.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: 01ca0537be

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/common/utils/tokens/models-extra.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: cb5ac4b075

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cb5ac4b075

ℹ️ 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".

Comment thread src/node/config/index.ts Outdated
Comment thread src/node/config/index.ts
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 64169a3fa5

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33

Copy link
Copy Markdown
Member Author

Review-gate bookkeeping: the Codex Review Summary card (node IC_kwDOPxxmWM8AAAABUnaNuQ, body sha256[0:16] d1158341d515a122) was minimized as RESOLVED after verifying: all 4 findings across rounds 1–2 are fixed with inline replies, all review threads are resolved, and both the Code Review and Security Review rows show Completed on the current head 64169a3 with no new findings. The Codex Comments CI job counts the mutable summary card as unresolved even after settlement (known checker limitation); minimizing only that card is its supported resolution. This will be re-assessed if the head or review state changes.

@ThomasK33

ThomasK33 commented Sep 22, 2026

Copy link
Copy Markdown
Member Author

Launch UI evidence — Sol and Luna

Exact source: 40e4b2a6b8d116d75fcda76b156ea9d5a5a0520c. Functional UI checks only, not another code/security review or provider-availability test.

  1. At 1440×1000 and 390×844, both GPT-6 models are visible in the normal selector. Selections persist after reload. GPT-5.6 Sol and Luna remain selectable.
  2. Phone controls distinguish Sol 6 / Luna 6 from Sol / Luna. Both new models show all six reasoning levels and Pro after explicitly lowering the fixture's minimum effort to Off. Max and Pro controls were exercised without sending messages.
  3. Genuine app, fresh HOME/XUM_ROOT, fake non-secret key and non-serving loopback endpoint. Backend/Vite each had exactly nine allowlisted environment names and zero extras. Source stayed clean; owned browser/server processes were stopped.

Limits: this was an unsent scratch draft, not a persistent-workspace send. No live API, Codex or gateway call. Negative Pro-route gating is covered by targeted automated tests, not these UI recordings. A supplementary phone Sol-reload clip showed only its earlier state and was excluded; the phone Sol reload has screenshot/snapshot evidence instead. The two accepted recordings below were decoded and inspected.

Screenshots

Both released GPT-6 models in the normal selector

GPT-6 Sol reasoning controls at 390px

GPT-6 Luna reasoning controls at 390px

Desktop recording

desktop.webm

Phone recording

mobile.webm

Generated with xum • Model: coder:openai/gpt-6-astra • Thinking: xhigh • Cost: $75.88

@ThomasK33

Copy link
Copy Markdown
Member Author

Final handoff — blocked for merge, not a release-ready verdict

Both GPT-6 Sol and Luna are implemented at 40e4b2a6b8d116d75fcda76b156ea9d5a5a0520c.

  1. Local make static-check and 855 tests / 18 files passed. Exact-head CI run 35771257885 and Visual Regression Testing passed. Optional Pixel / Review remains pending.
  2. Desktop/390px fixture UI validation passed; screenshots and recordings are uploaded and hash-verified. No real inference was sent. Official release is verified independently; gateway/account access is not.
  3. Stopping at the authorized review cap: three paired rounds = six code/security executions, plus the existing one advisor pass. All four threads are resolved, but the last verdict covers 64169a3, not this launch head. wait_pr_codex.sh --once still returns 10 (pending). The green CI Codex Comments check is not fresh approval. No further review/advisor was requested or review-board state changed.
  4. PR remains draft/unmerged. Current-head review coverage requires new maintainer direction; no gate is waived. The historical advisor recommendation (scope reduction before release) remains recorded, not relabeled as approval. Pre-existing GPT-5.6 pricing and Astra-cap discrepancies are tracked separately in 🤖 fix: reconcile GPT-5.6 Sol promotional pricing and Astra Codex context cap #4347.

The PR body preserves the full post-cap sequence, including the earlier f04892f and 782cca6 work. This is the final validation/readiness record for the expanded handoff.


Generated with xum • Model: coder:openai/gpt-6-astra • Thinking: xhigh • Cost: $75.88

@ThomasK33
ThomasK33 marked this pull request as ready for review September 22, 2026 19:38

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 40e4b2a6b8

ℹ️ 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".

Comment thread src/common/types/thinking.ts Outdated
@ThomasK33
ThomasK33 marked this pull request as draft September 22, 2026 19:50
@ThomasK33
ThomasK33 marked this pull request as ready for review September 22, 2026 20:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfc0906fa6

ℹ️ 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".

Comment thread src/common/utils/ai/providerOptions.ts Outdated
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a4c7c15635

ℹ️ 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".

Comment thread src/node/services/providerModelFactory.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: a4c7c15635

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread src/common/utils/tokens/models-extra.ts Outdated
@ThomasK33 ThomasK33 changed the title 🤖 feat: add GPT-6 Sol and GPT-6 Luna as first-class released models 🤖 fix: make GPT-6 Sol/Luna reasoning none reach the wire and correct their Codex context cap Sep 22, 2026
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 2c4803c0c9

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: 2c4803c0c9

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

… correct their Codex context cap

Stacked on #4350, which makes a requested reasoning_effort "none" reach
the wire for GPT-6 Sol/Luna. Headless tool loops (Dream consolidation,
memory harvest, refine, sidebar status) call streamText with tools and
no provider options, so nothing requests "none" and Chat Completions
defaults to medium, which rejects function calling. A model-boundary
middleware fills in "none" for tool-bearing Chat Completions requests
that asked for no effort, wrapped outside #4350's body-patching wrapper
so the injected value survives the SDK; explicit caller efforts are left
alone. The Coder openai-compat path resolves scoped "Treat as" aliases
through resolveModelForMetadata before clamping. The assumed 372K Codex
OAuth cap for Sol/Luna becomes the 272K published in the pinned Codex
catalog.

_Generated with `xum` • Model: `coder:anthropic/claude-fable-5-1` • Thinking: `xhigh` • Cost: `$174.60`_

<!-- mux-attribution: model=coder:anthropic/claude-fable-5-1 thinking=xhigh costs=174.60 -->
@ThomasK33
ThomasK33 changed the base branch from main to gpt6-reasoning-none-followup September 22, 2026 21:52
@ThomasK33 ThomasK33 changed the title 🤖 fix: make GPT-6 Sol/Luna reasoning none reach the wire and correct their Codex context cap 🤖 fix: clamp GPT-6 Sol/Luna headless tool loops to reasoning none and correct their Codex context cap Sep 22, 2026
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: c9a0f57238

ℹ️ 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".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: c9a0f57238

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

This branch was successfully deployed

1 active deployment
staging - docs c9a0f572 Deployed Sep 22, 2026 by mintlify[bot]
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.

1 participant