fix(approval): ignore leaked HERMES_CRON_SESSION in interactive sessions (#56771) - #644
Open
hashbender wants to merge 1 commit into
Open
hashbender wants to merge 1 commit into
hashbender wants to merge 1 commit into
Conversation
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.
Summary
_is_cron_approval_context()soHERMES_CRON_SESSIONalone does not classify a call as cron when a live interactive session is active.HERMES_GATEWAY_SESSION, interactive CLI flag, or a boundHERMES_SESSION_KEYcontextvar.platformbindings without a session key) still honorapprovals.cron_mode.Fixes NousResearch#56771
Why
The cron scheduler sets
HERMES_CRON_SESSIONprocess-wide. When that env leaks into a Telegram/gateway session,execute_codewas blocked with the cron-deny message even though a user was present to approve.Test plan
pytest tests/tools/test_cron_session_env_leak_56771.py(3/3)pytest tests/tools/test_cron_approval_mode.py tests/tools/test_execute_code_approval_cluster.py(48/48)Mirror-of: NousResearch#56788
NousResearch#56788