Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/acp/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ async def _receive_loop(self) -> None:
await self._process_message(message)
except asyncio.CancelledError:
return
# EOF: the remote end closed the connection. Reject any in-flight
# outgoing requests so their callers receive an error instead of
# hanging forever. Without this, a subprocess crash during
# initialize() or new_session() silently converts into an infinite
# hang because _on_receive_error is only invoked on exceptions.
self._state.reject_all_outgoing(
ConnectionError("Connection closed: remote end sent EOF")
)

async def _process_message(self, message: dict[str, Any]) -> None:
method = message.get("method")
Expand Down
Loading