Conversation
5 tasks
Contributor
|
Closing as already resolved on main. The The remaining malformed-env-var crash sites across the rest of the gateway/agent were just swept up in #49558 (canonical Thanks for the fix — appreciated. |
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
This fixes a gateway crash when
HERMES_MAX_ITERATIONScontains an invalid value.The gateway still had a few runtime paths using raw
int(os.getenv(...))parsing forHERMES_MAX_ITERATIONS. If the env var was malformed, startup logging, background-task execution, or normal message handling could fail withValueErrorinstead of falling back safely.This patch aligns those gateway paths with the already-hardened behavior used elsewhere in the repo.
What Changed
_max_iterations_env()helper ingateway/run.py90Validation
HERMES_MAX_ITERATIONS=not-a-numberduring gateway runtimeValueErrorcould break startup log path or turn execution90and logs a warningHERMES_MAX_ITERATIONS=" 42 "42Files Changed
gateway/run.pytests/gateway/test_runtime_env_reload_config_authority.pyTests
Added regression coverage for:
HERMES_MAX_ITERATIONSvalues falling back to90Verification
pytest tests/gateway/test_runtime_env_reload_config_authority.py -q 4 passed in 3.55s