Files
hermes-agent/tests
kshitijk4poor d79480f128 fix(anthropic): rotate the published aux key in place so the turn thread sees it
Gate finding B15-1 (Medium): the pre-dispatch refresh runs inside the request
worker's copied Context (_context_thread_target -> contextvars.copy_context().run),
so re-calling _publish_runtime_main rebound the ContextVar only in that copy; the
turn thread's later `auto` aux calls (approvals, goal judge, plugin llm) still read
the revoked token. rotate_runtime_main_api_key mutates the already-published dict
(shared by both contexts) when it still holds the old key, then refreshes the
legacy mirrors. No cross-session leak: set_runtime_main builds a fresh dict per
turn, so the shared object is this turn's only.

The kept e2e test now runs the refresh on a thread under _context_thread_target;
red on the previous head, green here.
2026-10-07 13:20:42 +05:30
..