hermes-agent/website/docs/developer-guide
Teknium dd7921d514
fix(honcho): isolate session routing for multi-user gateway (#1500)
Salvaged from PR #1470 by adavyas.

Core fix: Honcho tool calls in a multi-session gateway could route to
the wrong session because honcho_tools.py relied on process-global
state. Now threads session context through the call chain:
  AIAgent._invoke_tool() → handle_function_call() → registry.dispatch()
  → handler **kw → _resolve_session_context()

Changes:
- Add _resolve_session_context() to prefer per-call context over globals
- Plumb honcho_manager + honcho_session_key through handle_function_call
- Add sync_honcho=False to run_conversation() for synthetic flush turns
- Pass honcho_session_key through gateway memory flush lifecycle
- Harden gateway PID detection when /proc cmdline is unreadable
- Make interrupt test scripts import-safe for pytest-xdist
- Wrap BibTeX examples in Jekyll raw blocks for docs build
- Fix thread-order-dependent assertion in client lifecycle test
- Expand Honcho docs: session isolation, lifecycle, routing internals

Dropped from original PR:
- Indentation change in _create_request_openai_client that would move
  client creation inside the lock (causes unnecessary contention)

Co-authored-by: adavyas <adavyas@users.noreply.github.com>
2026-03-16 00:23:47 -07:00
..
_category_.json feat: add documentation website (Docusaurus) 2026-03-05 05:24:55 -08:00
acp-internals.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
adding-providers.md docs: add provider contribution guide 2026-03-14 19:22:47 -07:00
adding-tools.md feat: add documentation website (Docusaurus) 2026-03-05 05:24:55 -08:00
agent-loop.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
architecture.md docs: add provider contribution guide 2026-03-14 19:22:47 -07:00
context-compression-and-caching.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
contributing.md docs: add provider contribution guide 2026-03-14 19:22:47 -07:00
creating-skills.md docs: stabilize website diagrams 2026-03-14 22:49:57 -07:00
cron-internals.md feat: add multi-skill cron editing and docs 2026-03-14 19:18:10 -07:00
environments.md docs: stabilize website diagrams 2026-03-14 22:49:57 -07:00
gateway-internals.md fix(honcho): isolate session routing for multi-user gateway (#1500) 2026-03-16 00:23:47 -07:00
prompt-assembly.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
provider-runtime.md docs: fallback providers + /background command documentation 2026-03-15 06:24:28 -07:00
session-storage.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
tools-runtime.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00
trajectory-format.md docs: add ACP and internal systems implementation guides 2026-03-14 00:29:48 -07:00