From 1149f2b69a2725cd12152e914f9455a0196729d5 Mon Sep 17 00:00:00 2001 From: Chojan Shang Date: Sat, 28 Nov 2026 13:17:02 +0800 Subject: [PATCH] fix: suppress ProcessLookupError on stdio shutdown and drop unmatched v1 AuthMethod map key --- scripts/gen_schema_v1.py | 2 +- src/acp/transports.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/gen_schema_v1.py b/scripts/gen_schema_v1.py index 86ed167c..f1aa73b3 100644 --- a/scripts/gen_schema_v1.py +++ b/scripts/gen_schema_v1.py @@ -20,7 +20,7 @@ for variant_names in ( variant_model_map("AgentResponse", "anyOf", "object", ("AgentResponseMessage", "AgentErrorMessage")), variant_model_map("ClientResponse", "anyOf", "object", ("ClientResponseMessage", "ClientErrorMessage")), - variant_model_map("AuthMethod", "anyOf", "allOf", ("TerminalAuthMethod", "AgentAuthMethod")), + variant_model_map("AuthMethod", "anyOf", "allOf", ("TerminalAuthMethod",)), variant_model_map("McpServer", "anyOf", "allOf", ("HttpMcpServer", "SseMcpServer", "AcpMcpServer")), variant_model_map( "SetSessionConfigOptionRequest", diff --git a/src/acp/transports.py b/src/acp/transports.py index 82a4de6e..9207a940 100644 --- a/src/acp/transports.py +++ b/src/acp/transports.py @@ -104,9 +104,11 @@ async def spawn_stdio_transport( try: await asyncio.wait_for(process.wait(), timeout=shutdown_timeout) except asyncio.TimeoutError: - process.terminate() + with contextlib.suppress(ProcessLookupError): + process.terminate() try: await asyncio.wait_for(process.wait(), timeout=shutdown_timeout) except asyncio.TimeoutError: - process.kill() + with contextlib.suppress(ProcessLookupError): + process.kill() await process.wait()