Skip to content

[ENG-3419] Honor the selected reasoning effort in cloud turns - #568

Open
tino097 wants to merge 9 commits into
stagingfrom
tino097/eng-3419-cloud-turns-honor-the-reasoning-effort-the-user-selected
Open

tino097 wants to merge 9 commits into
stagingfrom
tino097/eng-3419-cloud-turns-honor-the-reasoning-effort-the-user-selected

Conversation

@tino097

@tino097 tino097 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

https://linear.app/mindsdb/issue/ENG-3419

What changed

  • Apply selected reasoning effort in cloud Anton sessions: an optional reasoning_effort on TurnRequestV1 sets the planning model's effort only; coding and history summarization keep their configured effort
  • Fall back to the default effort when the request carries a non-string value: a malformed value no longer fails the turn
  • Read the requested effort once and treat a blank value as unset: " " keeps the configured effort
  • Resend once at the configured effort when the provider refuses the selected one: a fallback provider around the planning role, removed again below
  • Document the effort fallback provider's methods: docstrings only, removed again below
  • Replace the effort fallback provider with the planning effort setting: the selected effort is applied through settings.planning_reasoning_effort next to the model assignment, so the client factory and its callers are unchanged from staging
  • Assert the selected effort on the wire instead of a private builder: the tests drive real clients over a mock transport and check the reasoning_effort each role's request carried
  • Drop the leftover docstring on the client factory: no code change
  • Build the streamed answer in the session tests and document the effort helpers: tests only

Notes for the reviewer

  • Effort is planning only on purpose. The router shares the coding provider when none is configured, so changing coding effort would also change summarization.
  • An unadvertised level never fails the turn, and the pod does not judge it. cowork-server drops a level the model does not advertise when the org catalog is cached. Otherwise the gateway clamps an off-ladder level to the nearest rung or the alias default and drops one it cannot carry; it never answers 400. Every cloud job carries the gateway llm block, so no other provider sees the value.
  • The fallback provider is gone. The gateway never refuses a level, so the resend could not fire on the cloud path; the net diff is the contract field, the one setting assignment, and tests.
  • Cross repo contract. The field is optional; an older pod ignores the key.

Ships with

Checks

Check Observed result
uv run pytest (full suite, at the wire test commit) 5043 passed, 91 skipped, 1 failed: the live fetch of example.com, which passed when rerun alone
uv run pytest tests/test_cloud_turn_session.py tests/test_cloud_turn_contract.py tests/test_cloud_turn_process.py tests/test_cloud_turn_usage_notes.py tests/test_client.py tests/test_bad_request_reaches_the_classifier.py at the head 243 passed

🤖 Generated with Claude Code

tino097 and others added 5 commits October 13, 2026 15:24
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… value.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lected one.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T15:09:00.097172Z 6fb32e1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 6fb32e1c19

ℹ️ 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".

Comment thread anton/core/llm/client.py Outdated
Comment on lines +192 to +194
async for event in provider.stream(**kwargs):
started = True
yield event

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Close delegated streams when the wrapper is closed

When a selected-effort planning stream is cancelled or its consumer stops early, LLMClient._guarded_stream closes this wrapper, but the bare async for does not close the underlying provider async generator. Consequently, its HTTP response can remain open—and potentially continue consuming server resources—until async-generator finalization. Wrap both delegated streams in contextlib.aclosing, as the other provider delegation paths do.

Useful? React with 👍 / 👎.

tino097 and others added 4 commits October 13, 2026 18:45
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…t helpers

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant