fix(gateway): staged inactivity warning before timeout escalation#6263
Closed
Helmi wants to merge 1 commit into
Closed
fix(gateway): staged inactivity warning before timeout escalation#6263Helmi wants to merge 1 commit into
Helmi wants to merge 1 commit into
Conversation
Introduce gateway_timeout_warning (default 900s) as a pre-timeout alert layer. When inactivity reaches the warning threshold, a single notification is sent to the user offering to wait or reset. If inactivity continues to the gateway_timeout (default 1800s), the full timeout fires as before. This gives users a chance to intervene before work is lost on slow API providers without disabling the safety timeout entirely. Config: agent.gateway_timeout_warning in config.yaml, or HERMES_AGENT_TIMEOUT_WARNING env var (0 = disable warning).
Contributor
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.
What does this PR do?
Adds a pre-timeout warning layer to the gateway inactivity timeout mechanism. When the agent has been idle for
gateway_timeout_warningseconds (default: 15 min), a single notification is sent to the user. If inactivity continues togateway_timeout(default: 30 min), the full timeout fires as before.This gives users a chance to intervene on slow API providers without disabling the safety timeout.
Related Issue
Fixes #6260
Type of Change
Changes Made
hermes_cli/config.py: Addedgateway_timeout_warningdefault (900s) toDEFAULT_CONFIG["agent"]gateway/run.py: Bridgegateway_timeout_warningconfig key →HERMES_AGENT_TIMEOUT_WARNINGenv var; poll loop sends a single warning notification before escalating to full timeoutcli-config.yaml.example: Documentedgateway_timeoutandgateway_timeout_warningunder theagent:sectiontests/gateway/test_gateway_inactivity_timeout.py: New test suite covering warning fires once, warning disabled at 0, warning skipped on unlimited timeout, full timeout still fires after warning, env var parsingHow to Test
gateway_timeout_warning: 900andgateway_timeout: 1800in~/.hermes/config.yamlgateway_timeout_warning: 0— verify no warning firespytest tests/gateway/test_gateway_inactivity_timeout.py -vChecklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.exampleif I added/changed config keysCONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — N/AScreenshots / Logs
Example warning message: