mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-26 17:38:36 +00:00
_set_session_context() called set_session_vars() without session_id, so the HERMES_SESSION_ID contextvar was set to "" (explicitly empty) on every prompt.submit / session bind. The subprocess-env bridge (_inject_session_context_env) treats an explicit "" as authoritative and does NOT fall back to os.environ, so terminal/execute_code commands in a dashboard/TUI/web session saw an empty $HERMES_SESSION_ID — even though agent_init had populated it via set_current_session_id(). Every other set_session_vars() call site (gateway/run.py, cron, api_server) passes session_id; tui_gateway was the only one that dropped it, affecting all three of its frontends (Ink TUI, desktop, web). Fix: derive the live id in the existing _sessions lookup loop (agent.session_id, falling back to session_key — same derivation used at session finalize) and pass it through to set_session_vars. Adds tests/tui_gateway/test_session_id_injection.py covering agent id, session_key fallback, and unknown/ephemeral key. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| _stdin_recovery.py | ||
| compute_host.py | ||
| entry.py | ||
| event_publisher.py | ||
| git_probe.py | ||
| host_supervisor.py | ||
| loop_noise.py | ||
| project_tree.py | ||
| render.py | ||
| server.py | ||
| slash_worker.py | ||
| synthetic_turn.py | ||
| transport.py | ||
| turn_marker.py | ||
| ws.py | ||