Skip to content

fix(sender): settle sends when the loop terminates - #170

Open
Ehsan-hash wants to merge 2 commits into
agentclientprotocol:mainfrom
Ehsan-hash:fix/sender-terminal-state
Open

Ehsan-hash wants to merge 2 commits into
agentclientprotocol:mainfrom
Ehsan-hash:fix/sender-terminal-state

Conversation

@Ehsan-hash

Copy link
Copy Markdown

Why

When the sender loop fails or is cancelled, concurrent requests can wait forever for a send that will never complete. Keep a terminal sender state so active, queued and later sends all finish.

What changed

  • Propagate the original writer error to outstanding and later sends.
  • Preserve cancellation during shutdown, including cancellation before the sender loop starts.
  • Add sender lifecycle regressions and a two-request regression through Connection.

Scope

Blast Radius

Changes how pending sends terminate after writer failure or shutdown. Existing peer cancellation, stdio and HTTP/WebSocket tests pass.

Verification

  • Unchanged source: 5 failed, 7 passed; fixed focused regressions: 12 passed.
  • Affected RPC, cancellation, recovery and logging tests: 75 passed.
  • make check passes; make test: 413 passed, 1 skipped on Python 3.12. The skipped Gemini integration was not enabled.

Developed and reviewed with AI assistance using Codex. No live model/provider calls were used for validation.

Developed with AI assistance using Codex. Regression tests intentionally fail until the sender lifecycle fix follows.
Retain writer failures for active, queued and later sends. Preserve cancellation during shutdown and reject sends after closure, including cancellation before the sender loop starts.

Developed and reviewed with AI assistance using Codex.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant