Add verification stop loop - #52296
Conversation
1fb7152 to
6375628
Compare
Make verification closure the default coding behavior after landed file edits while keeping bounded retries and config/env switches for users who need to disable it.
6375628 to
2f1a47b
Compare
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Well-structured verify-on-stop loop implementation. The feature is well-scoped with proper config/env escape hatches, bounded retry loop, and clean separation of concerns. Good test coverage.
Changes:
agent/conversation_loop.py: Verification check before accepting final answeragent/tool_dispatch_helpers.py: New_extract_landed_file_mutation_pathsfunctionagent/turn_context.py: Per-turn verification state initializationagent/verification_stop.py: New module withbuild_verify_on_stop_nudgeandverify_on_stop_enabledhermes_cli/config.py: Newverify_on_stopconfig optionrun_agent.py: Re-export of_extract_landed_file_mutation_pathstests/agent/test_verification_stop.py: Comprehensive test suitetests/run_agent/test_file_mutation_verifier.py: Updated tests for landed paths
LGTM.
Reviewed by Hermes Agent
The verify-on-stop guard (PRs #52296, #52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
The verify-on-stop guard (#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
|
This seems to be having pretty bad effects for me with multiple backend llms including qwen 27b. The agent is misinterpreting the prods from it as instructions to go run the code it just wrote even when I keep telling it to not do so I can review it. It's also mistaking it as other commands from me and just confusing thing. I'm not sure if it's unique to me, but between this and a sudden new problem with context cache invalidation I've rolled back to a prior commit I was on. (I see I could just turn this off .. but I doubt this is the cause of the cache problem). |
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
…p-loop Add verification stop loop
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
…p-loop Add verification stop loop
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
…p-loop Add verification stop loop
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
…p-loop Add verification stop loop
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
You aren't the only one. This had all kinds of issues for me. I'm glad I finally happened upon a way to disable it. Running GPT-5.6 sol and this was causing failed verification loops because it insisted the verification script be written and run from somewhere the agent didn't have access to. |
…p-loop Add verification stop loop
The verify-on-stop guard (PRs NousResearch#52296, NousResearch#52297) defaulted ON for every session, so on gateway messaging surfaces (Telegram, Discord, etc.) the model complied with the nudge by writing a hermes-verify temp script and emitting an ad-hoc verification summary, which the gateway delivered to the end user as chat noise. Resolve a surface-aware default instead. The DEFAULT_CONFIG value becomes the sentinel "auto", which verify_on_stop_enabled() resolves to ON for interactive coding surfaces (CLI, TUI, desktop) and programmatic callers, and OFF for conversational messaging surfaces. The surface is read from HERMES_SESSION_PLATFORM (what the gateway actually binds), with HERMES_SESSION_SOURCE and HERMES_PLATFORM as fallbacks, matching the sibling resolution in skill_commands.py and prompt_builder.py. An explicit HERMES_VERIFY_ON_STOP env var or a boolean agent.verify_on_stop config still overrides in either direction. The passive evidence ledger and the call site are untouched.
…53223) The verify-on-stop guard (NousResearch#52296) printed '↻ Verification required before finishing' to the terminal on every internal nudge turn, adding noise to CLI/gateway sessions whenever code was edited without fresh passing checks. Demote the user-facing status emit to a logger.debug breadcrumb — the loop still nudges the model to verify before finishing, just silently.
Summary
agent.verify_on_stop/HERMES_VERIFY_ON_STOPbehavior for coding turns, with config/env escape hatches to disablewrite_file/patchedits during a turnStack
Stacked on #52285 (
bb/verify-ledger). This consumes the passive verification ledger; it does not depend on the desktop RPC in #52286.Test plan
scripts/run_tests.sh tests/agent/test_verification_stop.py tests/agent/test_verification_evidence.py tests/agent/test_coding_context.py tests/run_agent/test_file_mutation_verifier.py -- -q