Conversation
…xed lengths).
`submit=False` removed the submit tool but left the default proceed prompt ("...please call the `submit()` tool") and limit warnings ("Prepare to submit your answer") in place, so the model either called a tool that did not exist or decided it was done and stalled.
When `submit` resolves to False, `react()` now:
- uses a proceed prompt and limit warnings that do not mention submit (shared with `react_with_checkpoint_submit`, whose constants are now aliases of the new `NO_SUBMIT_*` ones);
- wraps a plain `str` `on_continue` in `_constant_on_continue`, which inspect's `react_no_submit` otherwise rejects;
- swaps the no-submit warning defaults into a custom `limit_message_config` unless it sets `defaults` itself.
`react()` also gains an explicit `proceed_prompt` argument (mirroring `react_with_gated_submit`) so YAML configs can change the text while keeping the limit usage messages. `_constant_on_continue` now only plays its message after a tool-less turn, matching what a `str` `on_continue` does when a submit tool is present, and returns the unchanged state for an empty message instead of emitting an empty user turn.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
JonathanGabor
approved these changes
Oct 2, 2026
There was a problem hiding this comment.
Thank you! Astra found one minor issue:
[P2] Preserve positional argument compatibility — agents.py:642. Inserting
proceed_promptbeforelimit_message_configshifts existing positional arguments. A previously valid call passing{"cost": None}as its eighth argument now treats that dictionary as prompt text and raises aChatMessageUservalidation error. Append the new parameter after the existing parameters instead. Reproduced against both the base and PR versions.
Also, I'm not super familiar with this repo, maybe @pipmc should give their take as well!
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.
Problem
react(submit=False)removes the submit tool but keeps the default continue messaging. After any turn with no tool calls the model is told "If you believe you have completed the task, please call thesubmit()tool", and limit warnings say "Prepare to submit your answer". The model then either calls a tool it doesn't have or decides it is done and stalls.This happens regardless of limits: the proceed prompt is sent after every tool-less turn even when no limits are set.
There is also no way to fix it from an eval-set YAML: inspect's
react_no_submitrejects a plainstron_continue,limit_message_config: nullfalls back to the same prompt as astr(also rejected), and a callable can't be written in YAML.Fix
When
submitresolves toFalse,react()now:NO_SUBMIT_PROCEED_PROMPT/NO_SUBMIT_LIMIT_MESSAGE_CONFIG; the checkpoint agent's constants are now aliases of these);stron_continuein_constant_on_continue, so a custom message works;limit_message_configunless it setsdefaultsitself.react()also gains aproceed_promptargument (mirroringreact_with_gated_submit) so a YAML config can change the text while keeping the limit usage messages.react_with_checkpoint_submitnow delegates to this logic instead of duplicating it.Behaviour change to note
_constant_on_continuepreviously played its message after every turn, including turns with tool calls. It now only fires after a tool-less turn, matching what astron_continuedoes when a submit tool is present, and returns the unchanged state for an empty message rather than emitting an empty user turn. This affectsreact_with_checkpoint_submitandreact_with_handoff_submitwhenlimit_message_config=None.Testing
13 new tests in
test_agent.pycover the default no-submit prompt and warnings, stringon_continue,limit_message_config=Noneand custom configs with and withoutdefaults,proceed_prompt, and_constant_on_continue. Fullpackages/agentssuite, ruff, and basedpyright pass.🤖 Generated with Claude Code