Skip to content

The agent that grows with you

fix(acp): drop the redundant copy_context around asyncio.to_thread

teknium1787b6ebd3a7d
diff --git a/acp_adapter/server.py b/acp_adapter/server.py
index c3fb6a0f36d..406e44e6a26 100644
--- a/acp_adapter/server.py
+++ b/acp_adapter/server.py
@@ -425,7 +425,7 @@ class HermesACPAgent(SlashCommandsMixin, acp.Agent):
set_session_cwd(state.cwd)
register_mcp_servers(configs)
- await asyncio.to_thread(contextvars.copy_context().run, _register_pinned)
+ await asyncio.to_thread(_register_pinned) # to_thread already runs in a copied context
except Exception:
logger.warning("Session %s: failed to register ACP MCP servers", state.session_id, exc_info=True)
return