Repository navigation
fix(ai): preserve declared reasoning tiers in embedded sessions - #146134
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 12, 2026, 1:49 PM ET / 17:49 UTC (Revision 4). ClawSweeper reviewWhat this changesPreserves explicitly declared advanced reasoning levels in embedded sessions and OpenAI-compatible requests while retaining API-specific defaults. Merge readiness✅ Ready for maintainer review This focused repair remains necessary on current main. No introduced correctness or security defect was found, and the refreshed branch preserves the reviewed implementation and its relevant runtime proof. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw resolves a requested reasoning level against model capabilities before recording the session and sending a provider request. The shared capability resolver connects configured model support to both session state and transport serialization. flowchart LR
A[Requested reasoning level] --> C[Shared capability resolver]
B[Model declarations and API defaults] --> C
C --> D[Embedded session and transcript]
D --> E[Provider effort mapping]
E --> F[Completions or Responses request]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -5, Tests +213. Total +208 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Use the existing reasoning contract consistently from session capability checks through provider serialization, preserving explicit declarations and API-specific ceilings. Do we have a high-confidence way to reproduce the issue? Yes, from source: a reasoning model declaring max only through compat reaches the map-only session clamp and records high. Reporter observations corroborate this; no runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. Reusing the existing effort resolver repairs the downstream capability decision without duplicating catalog projection, adding configuration, or changing stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 486b1fc315f5. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles)
|
Use the canonical reasoning-effort contract in the shared session clamp instead of a Responses-only bypass. Preserve declared custom-backend max through session transcripts and Completions serialization, including explicit mappings, null caps, and serialization opt-outs. Keep implicit native Chat Completions at its existing xhigh ceiling while Responses retains max. The API-specific default is proven by the hosted gpt-5.6-sol request contract; explicit compat remains authoritative. Related: #144866 Related: #90703 Related: #111367 Co-authored-by: Alex Govorov <[email protected]>
c31caa9 to
75bdfcb
Compare
|
Merged via squash.
|
…claw#146134) Use the canonical reasoning-effort contract in the shared session clamp instead of a Responses-only bypass. Preserve declared custom-backend max through session transcripts and Completions serialization, including explicit mappings, null caps, and serialization opt-outs. Keep implicit native Chat Completions at its existing xhigh ceiling while Responses retains max. The API-specific default is proven by the hosted gpt-5.6-sol request contract; explicit compat remains authoritative. Related: openclaw#144866 Related: openclaw#90703 Related: openclaw#111367 Co-authored-by: Alex Govorov <[email protected]>
Closes #144866.
Related: #90703, #111367, #130706.
What Problem This Solves
Fixes an issue where custom OpenAI-compatible models declare advanced reasoning tiers, but embedded session creation silently clamps
maxtohighbefore recording the child transcript. Completions also remapped every survivingmaxtoxhigh, including custom backends that explicitly declare nativemax.Why This Change Was Made
The shared thinking-level resolver now consumes the existing reasoning contract. Sessions and Responses use the same decision, and Completions leaves serialization to the existing provider mapping. Explicit compat declarations remain authoritative; implicit built-in defaults respect the selected API's ceiling. This removes competing policy and reduces production code by five lines.
Alex Govorov's work in #90703 informed the repair; contributor credit is preserved in the commits.
User Impact
Explicit custom
xhighandmaxsupport survives session creation and request serialization. Native defaults remain API-specific: forgpt-5.6-sol, a maximum request usesxhighon Completions andmaxon Responses. Undeclared-model defaults, explicit null caps, ordinary minimal/off behavior, and reasoning opt-outs remain covered.Evidence
maxto Completions and received HTTP 400. That failure led to the API-specific default repair; the original source/build/proof remains preserved.c31caa9a769bd20a56a16e7f9606853ea1111d24, 295 focused tests, the full cumulative changed-file checks, independent P2 review, and a normalpnpm buildpassed.OK, and natural exit. Explicit custom nativemaxremains covered. An earlier 9/16 fixture attempt omitted the proxy reasoning opt-in and remains qualified as failed.xhigh, Responses sentmax, and both received HTTP 200 with completedOKreplies. All 12,092 build outputs remained unchanged; task credential processes and isolated state were cleaned up.sessions_spawnrun. Azure retains its existing max-to-xhigh wire alias. Broader mapping/schema proposals in the related PRs are outside this cut.The final branch head is
75bdfcbbdcee9ed45cc9b8ea5283c989d4ecb262, a patch-identical carry onto current main after an unrelated CI failure. The failed run tested a merge with main that had 701 Gateway test roots; #146212 restored shard headroom while retaining the limits. On the refreshed branch, all 295 focused tests, the unchanged shard inventory check, and the full changed-file gate pass. All eight changed postimages and the relevant production/caller/dependency inputs match the reviewed candidate. The normal build, compiled cases, and hosted observations remain bound toc31caa9a769bd20a56a16e7f9606853ea1111d24; no new build or hosted run is claimed for the mechanical carry.