Repository navigation
Conversation
…r's default
Some provider endpoints cannot run without reasoning and refuse a request
sent with ReasoningEffort::None ("HTTP 400: Reasoning is mandatory for this
endpoint and cannot be disabled."). The refusal ended the run. With
RunPolicy::truncated_empty_reasoning_off the call after a dead one goes out
with reasoning off on whichever endpoint a router picks, so a run died
whenever that endpoint was one of these.
The refused request now goes out once more with no reasoning setting. It
is not counted as a retry and cannot repeat.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Contributor
Author
|
Closing: this will be handled by choosing providers that accept reasoning off, so no harness change is needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Some provider endpoints cannot run without reasoning. They refuse a request sent with
ReasoningEffort::None; OpenRouter relays it asHTTP 400: Reasoning is mandatory for this endpoint and cannot be disabled.That refusal ended the run.It bites hardest with
RunPolicy::truncated_empty_reasoning_off(#510): the call after a dead one goes out with reasoning off, on whichever endpoint a router picks next. A model served by many endpoints has some that refuse, so the recovery call itself killed the run.z-ai/glm-5.3-flashthrough OpenRouter. 8 of 42 agent runs in one pass, and 8 in an earlier pass, ended with this error after two or three good steps.invoke_model_resolving, a request that turns reasoning off and is refused for that reason goes out once more withreasoning: None, so the provider's own default applies. This covers the unary and the streaming path, and any caller that setReasoningEffort::None, not only the dead-call recovery.RunPolicy::retry, emits noRetryScheduled, and cannot repeat, because the resent request no longer turns reasoning off.reasoningtogether withmandatory,cannot be disabledorcan't be disabled), on aProvideror plainModelerror, and only when the request itself hadReasoningEffort::None. No provider gives this refusal a code of its own;classify_provider_failurereads messages the same way.API Or Behavior Changes
Behavior: a reasoning-off request refused as above is resent with the provider's reasoning default instead of failing. A caller that asked for no reasoning gets reasoning on such an endpoint, with a
warn!logged; the alternative was no answer at all. No public API change.Tests
New
agent_loop/model_call_reasoning_refused_tests.rs:a refused reasoning-off call is sent again with the provider's default;
another 400 on a reasoning-off call still fails, with one attempt;
a call that keeps its reasoning is sent once;
only a reasoning-off request refused for that reason counts (plain
Modelerror,Providererror, a request that asked for reasoning, an unrelated message, a non-model error).cargo fmt --checkcargo clippy --workspace --all-targets -- -D warningscargo clippy --all-targets --all-features -- -D warnings: not runcargo build --all-targets: not run on its own; clippy built all targetscargo build --all-targets --all-features: not runcargo test:cargo test -p tinyagents-harnessran: 3336 passed, 3 failed. The 3 areproviders::claude_code::drivertests that execute a stand-inclaudescript from a temp directory, which this machine's sandbox refuses ("Operation not permitted"). They do not touch this change. The other crates' tests were not run.cargo test --all-features: not runNot covered: no live run against a refusing endpoint. Which endpoint refuses is the router's choice per call, so it cannot be reproduced on demand.
Documentation
crates/tinyagents-harness/src/agent_loop/README.md(after the reasoning-off controls) and an Unreleased entry inCHANGELOG.md.🤖 Generated with Claude Code