Skip to content

fix(reasoning): resolve 400 errors and capability mismatch for gpt-5.6-luna - #14059

Merged
diegosouzapw merged 6 commits into
diegosouzapw:release/v3.8.51from
kang-heewon:investigate-luna-selector-reasoning
Sep 29, 2026
Merged

diegosouzapw merged 6 commits into
diegosouzapw:release/v3.8.51from
kang-heewon:investigate-luna-selector-reasoning

Conversation

@kang-heewon

Copy link
Copy Markdown
Contributor

Summary

Fixes an issue where configuring reasoning effort (such as max / ultra) on gpt-5.6-luna resulted in HTTP 400 errors ("Reasoning effort '...' is not supported by the configured target"), misrouted Chat Completions requests, or misleading capability warnings in the UI selector.

Root Causes & Fixes

  1. Model Capability & Registry Declarations:

    • Added supportedThinkingEfforts: ["low", "medium", "high", "xhigh", "max"] to GPT_5_6_API_CAPABILITIES (open-sse/config/providers/shared.ts).
    • Declared supportedThinkingEfforts in registries for GitHub Copilot, OpenCode Go, and OpenCode Zen.
    • Updated OpenCode Zen's gpt-5.6 family (sol, terra, luna) to use targetFormat: "openai-responses", avoiding upstream Chat Completions 400 rejection when combining reasoning effort and tools.
  2. Reasoning Routing Policy Capability Gate:

    • In src/lib/reasoningRouting/policy.ts::capabilityFor(), switched from replace(/^(?:codex|cx)\//, "") to modelIdForRegistry.toLowerCase().
    • Strips arbitrary provider namespace prefixes (e.g. openai/gpt-5.6-luna, github/gpt-5.6-luna) so they evaluate against the target model regex and static registry vocabulary as supported rather than throwing HTTP 400.
  3. UI Rules Editor & Selector (ReasoningRoutingRules.tsx):

    • Strips arbitrary provider prefix in supportsExtendedCodexEffort().
    • Excludes ultra effort from options when targeting Luna (isLunaTarget), accurately reflecting upstream support (Luna supports up to max; only Sol/Terra support ultra).
    • Clamps currentTargetEffort without causing cascading render warnings.

Verification

  • Added comprehensive unit tests in tests/unit/luna-reasoning-effort-400.test.ts covering:
    • openai-responses target format resolution for opencode-zen, github, and openai
    • Forced max reasoning effort on openai/gpt-5.6-luna, github/gpt-5.6-luna (supported)
    • Forced ultra reasoning effort on gpt-5.6-luna, codex/gpt-5.6-luna (unsupported)
  • Quality gates verified:
    • npm run typecheck:core: PASS (0 errors)
    • npm run lint: PASS (0 errors)
    • npm run check:cycles: PASS (0 cycles)
    • node --import tsx/esm --test tests/unit/luna-reasoning-effort-400.test.ts: PASS (5/5)

…6-luna

- Align policy capability check with provider stripping to correctly support reasoning effort on provider-prefixed models (e.g. openai/gpt-5.6-luna, github/gpt-5.6-luna)

- Declare supportedThinkingEfforts in GPT_5_6_API_CAPABILITIES, opencode-zen, opencode-go, and github registries

- Route gpt-5.6 family in opencode-zen to openai-responses format to prevent upstream Chat Completions 400 errors

- Exclude ultra effort for Luna in ReasoningRoutingRules UI and clamp current effort

- Add regression test coverage for Luna reasoning effort routing and capability gates
Copilot AI lite review requested due to automatic review settings September 18, 2026 03:48

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

…iegosouzapw#14059

The branch's local eslint run had silently deleted allowlist entries for
files this PR never touches (vertex registry/executor, several unrelated
test files). Restore the file to match the current release/v3.8.51 tip.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
@diegosouzapw
diegosouzapw merged commit ceddca9 into diegosouzapw:release/v3.8.51 Sep 29, 2026
6 of 7 checks passed
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