You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This threads HERMES_IGNORE_RULES through the two gateway AIAgent(...) construction paths that were still missing it:
the main cached/session agent path in gateway/run.py
the /background task path in gateway/run.py
I also added regression coverage for both paths in tests/gateway/test_session_model_override_routing.py.
Why
cli.py already turns HERMES_IGNORE_RULES=1 into skip_context_files=True and skip_memory=True, but gateway sessions were still building fresh agents without those flags. That meant Telegram and other gateway-driven sessions could keep injecting memory and context files even when the env var was set.
Validation
I couldn't get a full working clone of this repo to complete cleanly in this environment, so I wasn't able to run the repo's pytest target here. I did at least verify the edited Python files compile with python3 -m py_compile.
Took the smallest path I could here. The actual fix is just wiring HERMES_IGNORE_RULES into the two gateway AIAgent(...) constructors that were still bypassing it, plus a couple of regression tests so it does not drift again later. I couldn’t get a full local clone of this repo to finish cleanly in this environment, so I only verified syntax with python3 -m py_compile rather than a full pytest run.
Thanks for the focused regression fix. Current main still omits both flags in the background constructor at gateway/run.py:13408 and the fresh session-agent constructor at gateway/run.py:18292; agent/agent_init.py:1363 confirms that skip_memory=True prevents persistent-memory initialization, while agent/system_prompt.py:446 gates context-file injection on skip_context_files.
The original branch predates substantial movement in gateway/run.py, so salvage should relocate the same two additions into these current constructors and retain the two constructor-capture regressions.
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
area/configConfig system, migrations, profilescomp/gatewayGateway runner, session dispatch, deliveryP2Medium — degraded but workaround existssweeper:blast-containedSweeper blast radius: contained — one narrow path / opt-in / few userssweeper:risk-compatibilitySweeper risk: may break existing users, config, migrations, defaults, or upgradessweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context statetype/bugSomething isn't working
3 participants
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 changed
This threads
HERMES_IGNORE_RULESthrough the two gatewayAIAgent(...)construction paths that were still missing it:gateway/run.py/backgroundtask path ingateway/run.pyI also added regression coverage for both paths in
tests/gateway/test_session_model_override_routing.py.Why
cli.pyalready turnsHERMES_IGNORE_RULES=1intoskip_context_files=Trueandskip_memory=True, but gateway sessions were still building fresh agents without those flags. That meant Telegram and other gateway-driven sessions could keep injecting memory and context files even when the env var was set.Validation
I couldn't get a full working clone of this repo to complete cleanly in this environment, so I wasn't able to run the repo's pytest target here. I did at least verify the edited Python files compile with
python3 -m py_compile.Fixes #29911.