hermes-bsd/tests/acp
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
test_approval_isolation.py fix(acp): thread-safe interactive approval via contextvars 2026-06-30 03:24:58 -07:00
test_auth.py
test_edit_approval.py
test_entry.py
test_events.py fix(ci): rip out some xdist legacy stuff... how did these ever work?? 2026-06-26 19:15:18 -07:00
test_mcp_e2e.py
test_permissions.py
test_ping_suppression.py
test_registry_manifest.py
test_server.py
test_session.py fix(codex): seed app-server sessions with configured cwd 2026-06-21 16:39:02 -07:00
test_session_db_private_access.py
test_session_provenance.py
test_tools.py