hermes-agent/acp_adapter
georgex8001 62b9fb6623 fix(acp): thread-safe interactive approval via contextvars
Concurrent ACP sessions run on a shared ThreadPoolExecutor (max_workers=4).
Each _run_agent mutated the process-global os.environ["HERMES_INTERACTIVE"]
and restored it in finally, so one session's restore could clobber another's
set mid-run — dropping the second session onto the non-interactive
auto-approve path, executing a dangerous command without the approval
callback firing (GHSA-96vc-wcxf-jjff).

Replace the env-var flag with a thread/task-local contextvar in
tools.approval. The two HERMES_INTERACTIVE read sites in approval.py now go
through _is_interactive_cli() (contextvar-first, env fallback for legacy
single-threaded CLI callers). The ACP executor sets the contextvar instead
of os.environ; the existing contextvars.copy_context() wrapper isolates each
session's write.

Co-authored-by: Hermes Agent <127238744+teknium1@users.noreply.github.com>
2026-06-30 03:24:58 -07:00
..
__init__.py feat: restore ACP server implementation from PR #949 (#1254) 2026-03-14 00:09:05 -07:00
__main__.py feat: restore ACP server implementation from PR #949 (#1254) 2026-03-14 00:09:05 -07:00
auth.py feat(azure-foundry): add Microsoft Entra ID auth 2026-05-18 10:14:38 -07:00
edit_approval.py fix(acp): use tempfile.gettempdir() in workspace auto-approve 2026-05-19 03:05:10 -07:00
entry.py fix(tui): stop a cwd package named utils/proxy/ui from crashing the gateway child (#51693) 2026-06-23 23:29:45 -07:00
events.py fix(acp): use modes for edit auto-approval 2026-05-18 01:19:55 -07:00
permissions.py feat(acp): enrich permission request cards 2026-05-18 11:47:27 -07:00
provenance.py feat(acp): emit session provenance metadata for compression rotation (#41724) 2026-06-07 22:22:21 -07:00
server.py fix(acp): thread-safe interactive approval via contextvars 2026-06-30 03:24:58 -07:00
session.py fix(codex): seed app-server sessions with configured cwd 2026-06-21 16:39:02 -07:00
tools.py feat(moa): expose MoA presets as selectable virtual models (#46081) 2026-06-25 13:52:06 -07:00