← Back to Pull requests

fix(api): apply declared reasoning effort to Responses #6194

Closed
unknown closed this pull request without merging on Nov 27, 2026 07:26 UTC
View on GitHub
unknown unknown commented on Nov 25, 2026 15:06 UTC
Author

Fixes #6193

Direct /v1/responses requests now use the selected replica’s reasoning-effort declaration. Models without a declaration still return 200 for a named effort and omit it from generation. This includes 159 of 171 built-in families, among them qwen3 in the Xinference Codex example.

| Physical /v1/responses request | Before | After |
|---|---|---|
| Declared effort or alias | 200, requested value echoed | 200, requested value echoed and normalized value forwarded |
| Name outside a family’s declared values | 200, effort ignored | 400 before generation |
| Explicit name on a family without a declaration | 200, effort ignored | 200, effort ignored |
| Non-null, non-string effort | 200, effort ignored | 400 naming reasoning.effort |

On GLM-5.3, the shared Chat normalizer maps medium to template effort high in both config and raw_params, while Responses echoes medium. The direct route skips the replica-description lookup for omitted or null effort and for summary alone. The string "none" follows the family declaration. A replica that reports it is still loading returns 503 with Retry-After: 30.

Virtual models ignore named effort as before this PR. Responses echoes reasoning and omits reasoning_effort from the Chat payload sent to Token Router, including for GLM-5.3 with xhigh. A non-null, non-string effort returns 400 before routing. Routed effort is left to a separate change covering both version boundaries.

Tests

  • Windows CPython 3.10.20 and 3.14.6 each passed 336 focused tests. With the actual v4.2.0 Router and its shipped tokenizer, JSON and SSE each returned 200, echoed reasoning, and reached the recording Qwen3 model once. Effort was absent on both HTTP hops and from both model argument dictionaries.

  • On Ubuntu 24.04.5, 85 changed tests passed in each environment: Python 3.12.3 with Transformers 5.24.1, Python 3.12.3 with Transformers 4.57.6, and Python 3.10.22. Changed-file pre-commit and whole-tree mypy passed. The broader consumer run had 20 failures, 2,125 passes, and 6 skips on de4f00d0 and also failed on 9339fc6f.

  • Earlier direct-route probes returned pong, echoed medium, and recorded high in both model argument dictionaries for JSON and SSE. They used raw HTTP with OpenAI SDK 1.40.0 installed and client.responses.create with SDKs 1.66.3 and 3.31.0. Codex CLI and real-backend inference were not run.
  • AI disclosure: this was prepared with AI assistance (Claude Code with Claude Fable 5.2, and OpenAI Codex with GPT-6.2).

    Diff: 334 lines (+250 / -84) across 4 files Reviewer: Jackmeson1 Review duration: 2420m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 334 lines diff across 4 files
    0.42
    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.348
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #6194"
    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: 42.2% (MEDIUM) · Higher = larger blast radius
    42.2%
    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: 16.7% · Safe to merge
    16.7%