← Back to Pull requests

fix(runtime-host): ask auxiliary calls for the least reasoning each model accepts #5730

Closed
unknown closed this pull request without merging on Sep 26, 2026 14:37 UTC
View on GitHub
unknown unknown commented on Sep 25, 2026 15:04 UTC
Author

Summary

Daily Review and next-prompt suggestions ask for no reasoning by setting thinkingLevel: 'off'. On models that do not declare off, resolveThinkingLevel drops it, and the request then carries no effort at all. The provider falls back to its default reasoning: medium on GPT-5, o3 and GPT-6, and dynamic on Gemini 3.

#5629 worked around this for suggestions by refusing every such model, so on those models suggestions never appear. That includes GPT-6 Sol, Luna and Astra, GPT-5, o3/o4-mini and Gemini 3.x.

This PR adds leastReasoningThinkingLevel next to the wire builders in model-factory.ts. It picks the level that asks a model for the least reasoning it accepts:

  • 'off' when the model declares it;

  • also 'off' when the model declares no levels, or speaks Anthropic Messages, because there an omitted parameter already means no extended reasoning;

  • otherwise the model's lowest declared level (minimal/low), which the wire builders then send explicitly.
  • runHostAuxiliaryModelCall gains reasoning: 'least', which resolves this against the target model. Daily Review and prompt suggestions use it.

    Suggestions no longer refuse reasoning-only models. When a model can't turn reasoning off, their output budget grows from 128 to 1,024 tokens, because reasoning tokens count against it.

    Behaviour changes:

  • Daily Review on those models now sends an explicit lowest effort instead of running at the provider default.

  • Suggestions are now offered on them. That adds a paid call per reply for users who opted in.
  • Fixes #5690

    Verification

  • leastReasoningThinkingLevel is covered per provider, including the wire field it sends:

  • - gpt-5 → minimal; o3, gpt-6-sol and Codex gpt-6-astra → low; gemini-3.5-flash → minimal;
    - gpt-5.5 stays none and gemini-2.5-flash stays budget 0;
    - Anthropic effort models and undeclared models keep off, sending no effort or thinking.
  • The composition test now asserts the request body: gpt-5 sends reasoning.effort: 'minimal' with max_output_tokens: 1024, while off-capable models still send none with 128.

  • Real backend. I ran a Runtime Host on a copy of a Desktop workspace with a ChatGPT-subscription connection. This was measured with #5723 applied, because without it every Codex auxiliary call fails. Model gpt-6-astra, three turns, then session.prompt-suggestion.generate after each:

  • - main: none in about 0.4 s, and no request sent. The model is refused before the call.
    - This branch: a suggestion appears, e.g. "Yes, give me a checklist." (success, 313 in / 11 out, 0 reasoning tokens at low, 3.7 s).
    - With a 30 s deadline, all three calls came back in 3.2–8.3 s with 0–17 reasoning tokens.
  • runtime and runtime-host: tsc --noEmit passes, biome check passes on the changed files, and so do the touched suites (model-factory-thinking, prompt-suggestion, and the affected execution-model-composition cases).

  • On Windows, the composition cases need their temp-root rm to tolerate EBUSY from SQLite handles. That is a local test-harness issue and is not changed here.

  • I did not run the full workspace suites.

  • The pre-commit hook cannot run on Windows (biome.cmd spawnSync → EINVAL), so I ran its steps manually.
  • Review focus

  • Suggestion deadline. #5629's 5 s deadline is shorter than Codex's measured latency. With the default deadline, two of the three real calls above timed out and were discarded, so on Codex some suggestions will still not show. I have left that product value alone. It seems like a separate decision.

  • Output budget. The 1,024-token budget is headroom, not measured need. I only measured gpt-6-astra at low, with 0–17 reasoning tokens.

  • WorkHub routing. Intent and recall still reason at the Coordination Session's own level with an 80-token budget. I did not touch that here.
  • AI use

  • No generative tool made a substantive contribution

  • Generative tooling made a substantive contribution
  • Tool(s) and scope: Claude Code (Claude Opus) implemented the change and tests and ran the verification above; liugddx reviewed. The commit carries a Generated-by trailer.

    Checklist

  • Tests cover the change and fail without it

  • Lint, format, typecheck and the affected suites pass locally
  • Does this PR entail a change in behavior?

  • Yes — described under Summary above

  • No
  • 🤖 Generated with Claude Code

    Diff: 564 lines (+423 / -141) across 7 files Reviewer: liugddx Review duration: 1413m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.55) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.55 · 564 lines diff across 7 files
    0.55
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.379
    Shallow Review Depth shallow_review_depth
    0.289
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    1 comments
    "Review active on #5730"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 54.7% (MEDIUM) · Higher = larger blast radius
    54.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 21.6% · Safe to merge
    21.6%
    Repository