Skip to content

A deployment that refuses reasoning_effort none on tool requests too is not sent none again (#1353) - #1372

Merged
WaylandYang merged 3 commits into
deeplethe:devfrom
QuintinBotes:issue-1353-none-refused
Oct 26, 2026
Merged

WaylandYang merged 3 commits into
deeplethe:devfrom
QuintinBotes:issue-1353-none-refused

Conversation

@QuintinBotes

@QuintinBotes QuintinBotes commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1353: the optional point from the review of #1368.

Why

#1368 learns reasoning_effort: "none" for tool requests from the first refusal. If the retry with none is refused too, the deployment rejects none as well, and the flag would make every later tool request carry a value that cannot work.

What changes

  • In post_tools, a 400 on the retry whose error mentions reasoning_effort clears tools_without_effort before returning the error, so later tool requests go back to the configured effort. Any other 400 on the retry (context length, a bad tool schema) keeps the flag, so the next tool call does not pay an extra 400 to learn it again.

How it was checked

  • a_deployment_that_refuses_none_too_is_not_sent_none_again: an endpoint that refuses every tool body gets low, then none, the call fails, and the next tool body carries low again.
  • In rust:1 on top of dev c929083: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings (no warnings) and cargo test --locked --workspace (1,657 passed).

Before review

  • Every commit is signed off (git commit -s)
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass

…is not sent none again (deeplethe#1353)

Signed-off-by: Quintin Botes <quintinbotes@outlook.com>

@WaylandYang WaylandYang 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.

Thanks, this is the follow-up from #1368. One tightening: the clear at lib.rs:931 fires on any 400 from the retry, so an unrelated 400 there (context length, a bad tool schema) also forgets none, and the next tool call pays an extra 400 to learn it again. Please clear it only when the retry's error mentions reasoning_effort, and add a test where an unrelated 400 keeps the flag.

…ed 400 keeps it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Quintin Botes <quintinbotes@outlook.com>
@QuintinBotes

Copy link
Copy Markdown
Contributor Author

Done in ccb8fc3: the flag is cleared only when the retry's error mentions reasoning_effort, and an_unrelated_400_on_the_retry_keeps_none covers a context-length 400.

@WaylandYang

Copy link
Copy Markdown
Contributor

The clear is now limited to a retry that is refused for reasoning_effort, and the unrelated-400 test covers the other case. Please update the 'What changes' line in the description to match, then this can go in.

@QuintinBotes

Copy link
Copy Markdown
Contributor Author

Description updated.

@WaylandYang WaylandYang 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.

Thanks, the description matches the code now. Merging.

@WaylandYang
WaylandYang merged commit fb0caed into deeplethe:dev Oct 26, 2026
6 checks passed
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.

2 participants