fix: Honcho per-session uses stable session ID across WebUI turns — v0.50.155 (closes #855)

Pass gateway_session_key=session_id to AIAgent from streaming.py so Honcho per-session strategy pins to stable WebUI session ID rather than creating a new Honcho session each turn.
This commit is contained in:
nesquena-hermes
2026-04-22 13:48:52 -07:00
committed by GitHub
parent e151665131
commit 96cb880a12
2 changed files with 11 additions and 0 deletions

View File

@@ -1155,6 +1155,12 @@ def _run_agent_streaming(session_id, msg_text, model, workspace, stream_id, atta
_agent_kwargs['acp_args'] = _rt.get('args')
if 'credential_pool' in _agent_params:
_agent_kwargs['credential_pool'] = _rt.get('credential_pool')
# Pin Honcho memory sessions to the stable WebUI session ID.
# Without this, 'per-session' Honcho strategy creates a new Honcho
# session on every streaming request because HonchoSessionManager is
# re-instantiated fresh each turn (#855).
if 'gateway_session_key' in _agent_params:
_agent_kwargs['gateway_session_key'] = session_id
agent = _AIAgent(**_agent_kwargs)