feat: add opt-in subagent non-convergence guardrail - #68348
Closed
ajzrva-sys wants to merge 1 commit into
Closed
Conversation
teknium1
reviewed
Jul 30, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for targeting the distinct case where varied tool calls consume an iteration budget without converging. The premise remains relevant on current main: the loop is budget-bounded at agent/conversation_loop.py:1261, while guardrails reset per turn.
Problems
agent/conversation_loop.py:5093in this PR callsrecord_file_mutation()from the requested tool name, not a completed result. A failed or blockedwrite_file/patch, or a non-mutatingterminalcommand, resets the counter. Current main already receives result-aware data in both executor paths atagent/tool_executor.py:1183-1192andagent/tool_executor.py:1854-1864.- The
halt_afterbranch is advisory only: it appends text to a tool result and then continues. Current controlled halts instead set a halt decision and break atagent/conversation_loop.py:6099-6120. tests/agent/test_progress_tracker.pytests only the standalone counter; it does not exercise runtime integration, unsuccessful tools, concurrent/segmented dispatch, or stopping the next iteration.
Suggested changes
- Feed a tracker from post-execution, result-aware classification and make halt a real loop-exit decision through the existing controlled-halt path.
- Add integration coverage for sequential, concurrent, segmented, blocked, cancelled, and failed-result paths.
Automated hermes-sweeper review.
ajzrva-sys
force-pushed
the
feat/cross-turn-progress-tracker
branch
2 times, most recently
from
August 1, 2026 02:03
63166f0 to
d25ea5d
Compare
Contributor
Author
|
CI failures and reviewer feedback addressed in code but PR has gone stale. Closing to rethink approach — will reopen or create a fresh PR when ready. |
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
Delegated child agents can spend their entire iteration budget making different tool calls without producing user-visible output or landing work. Existing
tool_loop_guardrailsdetects repeated tool-call patterns, but it does not catch this broader non-convergence case.Related to #414. This circuit breaker complements iteration-budget handling; it does not replace it.
Solution
Add an opt-in non-convergence circuit breaker scoped strictly to
delegate_taskchildren.The tracker evaluates one complete model/tool round at a time:
write_fileorpatchresult counts as progress;warn_afteradds convergence guidance to the last tool result;halt_afterenters Hermes' existing controlled-halt path and terminates the child loop deterministically.The feature is disabled by default because a long read-only investigation may be productive even when it has not produced output yet.
Configuration
Changes
agent/progress_tracker.pynone/warn/haltdecisions;agent/agent_init.pyagent/conversation_loop.pyandrun_agent.pyhermes_cli/config_defaults.pyandcli-config.yaml.exampleValidation
A broader
tests/agent tests/run_agentrun reached the existing optional-dependency failures in the local minimal test environment (pytest-asyncioandanthropicare not installed); the focused runtime, guardrail, and file-mutation suites pass.Risk
The heuristic cannot know whether a long read-only investigation is useful. It is therefore delegated-child-only, configurable, and disabled by default.