Skip to content

fix(ai): match reasoning efforts case-insensitively without lowering provider values - #102993

Merged
steipete merged 5 commits into
openclaw:mainfrom
MonkeyLeeT:codex/102908-reasoning-effort-case
Jul 10, 2026
Merged

steipete merged 5 commits into
openclaw:mainfrom
MonkeyLeeT:codex/102908-reasoning-effort-case

Conversation

@MonkeyLeeT

@MonkeyLeeT MonkeyLeeT commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Related: #102908
Alternative to #102958
Supersedes #103169

What Problem This Solves

Canonical OpenAI-compatible reasoning effort values such as HIGH or XHIGH could miss lowercase supported-effort lists and silently fall through to a different effort.

Why This Change Was Made

The resolver now trims and folds only canonical reasoning effort names before lookup. Provider-native values remain case-sensitive and are emitted exactly as configured. Canonical-looking provider-native casing must be declared through reasoningEffortMap, which keeps provider output explicit and prevents values such as NONE from being mistaken for core control semantics.

The same normalization path is exercised by both OpenAI Responses and Chat Completions payload builders.

User Impact

Users get the intended reasoning effort even when canonical values use mixed casing or surrounding whitespace. Custom OpenAI-compatible providers keep their exact mapped payload labels.

Evidence

  • Blacksmith Testbox tbx_01kx4w5fxp81tfkw75hk0mjbk5: 471 focused and sibling tests passed across the resolver, both transports, shared Responses logic, stream wrappers, plugin SDK, Groq, and LM Studio.
  • Blacksmith Testbox: pnpm check:changed passed for the core and core-test lanes.
  • Blacksmith Testbox: pnpm build passed.
  • Real loopback HTTP/SSE proof exercised both transport stream implementations. Both requests returned HTTP 200 and captured canonical xhigh payloads:
{"responses":"xhigh","chatCompletions":"xhigh","paths":["/v1/chat/completions","/v1/responses"]}
  • Fresh Codex autoreview after the final fix reported no actionable findings.

Closes #102908

@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 2:34 PM ET / 18:34 UTC.

Summary
The PR folds canonical OpenAI reasoning-effort inputs and fallback-map keys case-insensitively while preserving configured provider-native payload values, with focused regression tests.

PR surface: Source +31, Tests +85. Total +116 across 2 files.

Reproducibility: yes. Current main leaves mixed-case canonical effort strings unchanged before exact supported-list matching, so the resolver can miss the intended effort and fall through; the PR body also includes loopback request-path proof.

Review metrics: none identified.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #102908
Summary: This PR is the current candidate fix for the open canonical reasoning-effort case-insensitive matching issue; the earlier alternative PR is closed superseded.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Next step before merge

  • [P2] No repair lane is needed because the current head has no blocking findings; normal CI and maintainer merge gates can handle the remaining review.

Security
Cleared: Security review cleared: the diff only changes in-repo TypeScript normalization logic and focused tests, with no dependency, workflow, secret, lockfile, package, or code-execution surface.

Review details

Best possible solution:

Land this PR after normal exact-head CI and maintainer merge gates, then close the linked canonical issue as implemented.

Do we have a high-confidence way to reproduce the issue?

Yes. Current main leaves mixed-case canonical effort strings unchanged before exact supported-list matching, so the resolver can miss the intended effort and fall through; the PR body also includes loopback request-path proof.

Is this the best way to solve the issue?

Yes. The current PR is the narrowest maintainable fix I found: fold canonical user-facing names and map keys while preserving provider-native configured values instead of lowercasing all compat payloads.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 188d109edaff.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted loopback OpenAI-compatible request output showing after-fix Chat Completions and Responses reasoning-effort payloads, including provider-native mapped values preserved.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted loopback OpenAI-compatible request output showing after-fix Chat Completions and Responses reasoning-effort payloads, including provider-native mapped values preserved.

Label justifications:

  • P2: This is a narrow provider reasoning-effort bug fix with limited blast radius and clear source/proof coverage, not an urgent runtime outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes redacted loopback OpenAI-compatible request output showing after-fix Chat Completions and Responses reasoning-effort payloads, including provider-native mapped values preserved.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted loopback OpenAI-compatible request output showing after-fix Chat Completions and Responses reasoning-effort payloads, including provider-native mapped values preserved.
Evidence reviewed

PR surface:

Source +31, Tests +85. Total +116 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 34 3 +31
Tests 1 85 0 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 119 3 +116

What I checked:

  • Repository policy applied: Root AGENTS.md was read fully; no scoped AGENTS.md exists under packages/ai, and the root policy required checking provider compatibility, callers, tests, related PRs, and sibling Codex source before verdict. (AGENTS.md:1, 188d109edaff)
  • Current main still has the bug: On current main, normalizeOpenAIReasoningEffort returns input unchanged and resolveOpenAIReasoningEffortForModel does exact supported-list matching, so canonical input like HIGH can miss lower-case built-in efforts and fall through. (packages/ai/src/providers/openai-reasoning-effort.ts:61, 188d109edaff)
  • PR implementation preserves provider-native values: The PR trims and folds only canonical OpenAI-owned effort names, then preserves mapped provider-native payload labels and returns case-matched configured compat values for unmapped canonical requests. (packages/ai/src/providers/openai-reasoning-effort.ts:70, c1c081e34e2d)
  • Regression coverage matches prior review blockers: The PR adds cases for mixed-case canonical efforts, provider-native mapped values, uppercase canonical-looking mapped values, unmapped uppercase supported values, uppercase map keys, and disabled OFF handling. (packages/ai/src/providers/openai-reasoning-effort.test.ts:39, c1c081e34e2d)
  • Runtime caller path checked: Chat Completions request construction resolves the selected reasoning effort through resolveOpenAIReasoningEffortForModel with compat.reasoningEffortMap before writing the request payload. (src/agents/openai-transport-stream.ts:4440, 188d109edaff)
  • Provider compat casing contract checked: Model catalog normalization trims supportedReasoningEfforts and reasoningEffortMap entries without lowercasing them, and public config docs describe reasoningEffortMap as the provider-specific value for a canonical level. (packages/model-catalog-core/src/model-catalog-normalize.ts:416, 188d109edaff)

Likely related people:

  • coolmanns: Blame on the current package-level OpenAI reasoning-effort helper and resolver points to commit 13821c9. (role: introduced current helper; confidence: high; commits: 13821c9d3450; files: packages/ai/src/providers/openai-reasoning-effort.ts, src/agents/openai-transport-stream.ts, src/agents/openai-reasoning-compat.ts)
  • vincentkoc: History around reasoningEffortMap and OpenAI-compatible transport seams includes multiple related provider compatibility commits. (role: adjacent provider compatibility contributor; confidence: medium; commits: 5ddca5dd56e9, 4798e125f40c; files: src/agents/openai-reasoning-compat.ts, src/agents/openai-transport-stream.ts)
  • steipete: Recent OpenAI reasoning normalization history includes earlier fixes to minimal/default reasoning behavior. (role: adjacent OpenAI reasoning contributor; confidence: medium; commits: 3fdc70a434ec, f27d382873c1; files: src/agents/openai-transport-stream.ts, packages/ai/src/providers/openai-reasoning-effort.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (4 earlier review cycles)
  • reviewed 2026-07-09T16:32:14.466Z sha 69e1235df1d72a2cceedb7a3d95598b2acddfc7d :: needs real behavior proof before merge. :: none
  • reviewed 2026-07-09T17:35:59.254Z sha 69e1235df1d72a2cceedb7a3d95598b2acddfc7d :: needs maintainer review before merge. :: none
  • reviewed 2026-07-09T17:48:28.567Z sha 69e1235df1d72a2cceedb7a3d95598b2acddfc7d :: needs changes before merge. :: [P1] Preserve canonical-looking provider compat values
  • reviewed 2026-07-09T18:05:36.526Z sha 3fba59c3667fd217c6d83af5b788c39554fd67c4 :: needs changes before merge. :: [P1] Preserve unmapped uppercase compat efforts

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Added redacted request-path proof to the PR body. It now includes a loopback OpenAI-compatible /v1/chat/completions capture showing mixed-case canonical XHIGH serializes as xhigh, plus a provider-native compat map case showing ProviderDefault is preserved instead of lowercased.

@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 9, 2026
@MonkeyLeeT
MonkeyLeeT marked this pull request as ready for review July 9, 2026 17:39

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69e1235df1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Addressed the single mapped-provider-value comment in 3fba59c3667. The resolver now preserves exact reasoningEffortMap outputs such as HIGH, added the requested focused regression, and updated the PR evidence with the new focused test plus loopback Chat Completions payload proof.

@clawsweeper

clawsweeper Bot commented Jul 9, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3fba59c366

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c4774ca4b4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@clawsweeper clawsweeper Bot removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 9, 2026
@steipete
steipete force-pushed the codex/102908-reasoning-effort-case branch from c5761e6 to cea2bdd Compare July 10, 2026 02:57
@openclaw-barnacle openclaw-barnacle Bot added size: S and removed docs Improvements or additions to documentation channel: telegram Channel integration: telegram app: web-ui App: web-ui gateway Gateway runtime scripts Repository scripts commands Command implementations extensions: deepseek extensions: xai size: XL labels Jul 10, 2026
@steipete

Copy link
Copy Markdown
Contributor

Land-ready at exact head cea2bdd.

What was tightened:

  • Canonical reasoning efforts are trimmed and matched case-insensitively.
  • Provider-native mapped labels retain exact casing.
  • Canonical-looking provider casing requires an explicit map, avoiding disabled-token ambiguity.
  • Regression coverage reaches both OpenAI Responses and Chat Completions payload builders.

Proof:

Known proof gap: a credentialed OpenAI request was unavailable because the Testbox had no OPENAI_API_KEY. Official OpenAI API documentation, direct Codex source, real SDK/HTTP loopback proof, exact-head hosted CI, and provider sibling tests cover the contract without weakening the merge gate.

@steipete
steipete merged commit 4c4609d into openclaw:main Jul 10, 2026
110 of 114 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 10, 2026
…provider values (openclaw#102993)

* fix(ai): match reasoning effort case-insensitively

* fix(ai): preserve mapped reasoning effort casing

* fix(ai): preserve unmapped reasoning effort casing

* fix(ai): match reasoning effort map keys by case

* fix(ai): harden reasoning effort normalization

Co-authored-by: Ted Li <[email protected]>

---------

Co-authored-by: Peter Steinberger <[email protected]>
obviyus added a commit that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Chulixx162Chulixx1622624/openclaw that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw/openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw/openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to u2022Ljw/openclaw that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw/openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw/openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Pauline20bPauline20b5207/openclaw that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw/openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw/openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to jperejil8047/openclaw that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw/openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw/openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to HasmukhJain1414HasmukhJain141433/openclaw that referenced this pull request Sep 19, 2026
…5248)

Related: #144866, #90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw/openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw/openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 20, 2026
…nclaw#145248)

Related: openclaw#144866, openclaw#90703

## What Problem This Solves

Fixes thinking controls offering and accepting advanced levels from provider-native labels such as `MAX` or `XHIGH`, even though the actual model request silently uses a lower level.

## User Impact

The model picker, session validation, and execution now agree on which advanced levels a custom provider supports. Lowercase canonical efforts still work, and explicit mappings such as `max: "MAX"` preserve the provider's exact wire value. Unsupported selections fail without changing the session or its runtime/account selection.

## Why This Change Was Made

The shared thinking profile incorrectly applied user-input aliases to provider-native capability labels. It now reads those labels exactly, preserving the [existing explicit-mapping policy](openclaw#102993 (comment)). Provider-owned profiles, explicit maps, and null opt-outs are unchanged; no new aliases or transport policy are introduced.

The earlier lowercase capability-admission bug is already fixed on main. This update addresses the remaining inconsistent advertisement rather than restoring the older transport changes.

## Evidence

A real isolated Gateway and secretless loopback HTTP provider exercised `models.list → sessions.patch → chat.send → chat.history`:

| Case | Before | After |
| --- | --- | --- |
| Unmapped native `MAX` / `XHIGH` | Advertised and accepted `max` / `xhigh`; actual wire used `high` | Not advertised; unsupported selection rejected; accepted `high` sends `high` |
| Canonical lowercase `max` | Session and wire `max` | Unchanged |
| Explicit `max → MAX` mapping | Session `max`, wire `MAX` | Unchanged |
| Explicit null opt-out | Selection rejected | Unchanged |

Rejected candidate selections left the complete persisted session row unchanged. A saved synthetic account selected through `/model`, its explicit OpenClaw runtime, and model identity survived both rejection and a subsequent real HTTP turn. A copied pre-fix session now displays its effective supported level instead of the unavailable Maximum choice.

- [Inspected before/after screenshots from the real Gateway UI](openclaw#145248 (comment)).
- New regression fails on the original shared profile; 137 focused policy/admission/wire-contract tests pass after the fix.
- Focused formatting and diff checks pass. Full static and matrix checks remain in hosted CI.
- Local provider responses were synthetic; no external provider or live-account behavior is claimed.

Co-authored-by: Ayaan Zaidi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

case-insensitive reasoning effort matching in resolveOpenAIReasoningEffortForModel

2 participants