fix: require positive signal in _is_unattended_context (Closes #1554) - #1555
Closed
Lexus2016 wants to merge 1 commit into
Closed
fix: require positive signal in _is_unattended_context (Closes #1554)#1555Lexus2016 wants to merge 1 commit into
Lexus2016 wants to merge 1 commit into
Conversation
_is_unattended_context() previously returned True whenever no interactive CLI, gateway, or cron session was detected — a catch-all "nobody's home" default. This caused CI test environments (non-interactive, non-gateway, non-cron) to evaluate as unattended, making tests expecting pending_approval see 'blocked' instead. Fix: require a positive signal (HERMES_CRON_SESSION or HERMES_SUBAGENT) instead of defaulting to True. This preserves the #1542 fix for actual cron/subagent sessions while not affecting tests or interactive sessions. Closes #1554 Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
Owner
Author
|
Closing: superseded by #1556. Code-review found #1555 ships dead code — its subagent detection relies on |
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.
Automated evolution PR for issue #1554.
Problem
PR #1550 (suppress pending_approval retries in cron/subagent contexts, #1542) has CI failures on test slices 2/8 and 8/8. Root cause:
_is_unattended_context()returnsTruewhenever there's no interactive CLI, no gateway, and no cron session — a catch-all "nobody's home" default. In the CI test environment (non-interactive, non-gateway, non-cron), this evaluates toTrue, causingcheck_all_command_guardsandcheck_execute_code_guardto returnblockedinstead ofpending_approval. Existing tests expectingpending_approvalbehavior break.Fix
Make
_is_unattended_context()require a positive signal (HERMES_CRON_SESSIONorHERMES_SUBAGENT) instead of the catch-all default. This preserves the #1542 fix for actual cron/subagent sessions while not affecting tests or interactive sessions.Files
tools/approval.py—_is_unattended_context()+_cron_blocked_result()+ 2 call sitestests/tools/test_approval_cron_block.py— 8 tests (updatedtest_no_context_not_unattendedto expectFalse)Checks
Closes #1554