fix(server): honor custom Claude model options#22792

draft6
main
fix/issue-16672
opened8d agobyJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 2h ago

Problem

Custom Claude model Thinking selections were saved but omitted from SDK launch settings and process identity. Reproduced on main 74541bab17 through an isolated web dev server and real Claude Code 2.1.303. Explicit effort was already preserved by 76f57f9b84.

Change

Compile SDK launch settings and query identity with the existing instance-scoped custom model catalog, preserving built-in mappings and explicit effort fallback. Fixes #16672.

Scope and approval

Fixes #16672

Triaged bug via the automated issue flow.

Evidence index and commands · 10-row behavior matrix · 223-test log. Final head b3f248adfd adds test fixtures only; its production tree exactly matches the after-runtime SHA. Additional SDK harness fixtures cover custom defaults/validation, boolean options, and prompt effort on send/steer.

Verification

Two added behavioural regressions fail on main and pass with the fix: custom Thinking Off reaches SDK settings with effort High preserved; unchanged Thinking reuses a query, and both toggle directions replace it. The implementation step passed 223 focused tests, targeted lint/formatting, and server typecheck. Final independent reviews at the current head returned MERGE from Codex GPT-6.1 Sol and Claude Opus 5.5. Proof audit pass 2 returned SUFFICIENT for all 10 matrix rows and independently reproduced 223 passing tests. The Claude reviewer also checked base production against the new tests: 11 fail on base; two deliberate controls pass.

Evidence

Real browser → isolated dev server → real Claude SDK. Custom dated Sonnet model saves effort High and Thinking Off. Before: query.open has effort high and showThinkingSummaries:true, no alwaysThinkingEnabled. After: false → true → false launches supply the selected boolean and keep effort high; all custom turns complete. The built-in Haiku control supplies alwaysThinkingEnabled:false before the fix; its upstream request returns unknown-provider.

No UI/render paths change. What else changed: custom option descriptors now supply parent launch, query identity, and prompt effort compilation; built-in mappings and existing subagent catalog behavior are retained.

Unverified: macOS, Windows, Electron shell, mobile, relay/tunnel, dynamic upstream catalog refresh; built-in Haiku upstream completion. This uses configured custom model capabilities, not the broader live catalog proposal in #16583.

Model/harness: GPT-6.1 Sol through Codex in T3 Code.

Checks

20 successful · 9 skipped
All checks passed
8d17b5e

Added 2 commits

  • test(server): takeover tests for custom Claude thinking2a8a94a
  • fix(server): honor custom Claude thinking at runtime95d0109
Synced from GitHub

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
CodexThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
CodexLive turn WebSocket wire1.2 KiB1.2 KiB0 B (0.0%)2.0 KiB✅
CodexLive turn WebSocket decoded21.6 KiB21.6 KiB0 B (0.0%)24.4 KiB✅
CodexLive turn messages220 (0.0%)8✅
ClaudeTotal thread wire5.0 KiB5.0 KiB0 B (0.0%)6.8 KiB✅
ClaudeThread snapshot wire3.8 KiB3.8 KiB0 B (0.0%)4.9 KiB✅
ClaudeLive turn WebSocket wire1.3 KiB1.3 KiB0 B (0.0%)2.0 KiB✅
ClaudeLive turn WebSocket decoded21.9 KiB21.9 KiB0 B (0.0%)24.4 KiB✅
ClaudeLive turn messages220 (0.0%)8✅

Baseline: da8cc59 · PR result: 8d17b5e · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 108.5 KiB
  • Claude decoded thread snapshot: 108.8 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Added 4 commits

  • test(server): cover custom Claude parent capabilitiesb3f248a
  • Merge branch 'main' into fix/issue-166721936739
  • Merge remote-tracking branch 'origin/main' into HEADb5de160
  • chore: remove stray patch backup8d17b5e