Skip to content

Add stream cancellation and JSON-RPC streaming request ID lifecycle tests - #153

Merged
MisterVVP merged 1 commit into
dev-add-sse-streaming-support-to-clientsfrom
dev-add-tests-for-libcurl-stream-cancellation
Jul 16, 2026
Merged

MisterVVP merged 1 commit into
dev-add-sse-streaming-support-to-clientsfrom
dev-add-tests-for-libcurl-stream-cancellation

Conversation

@MisterVVP

@MisterVVP MisterVVP commented Jul 16, 2026 •

Copy link
Copy Markdown
Owner

Motivation

  • Prove libcurl-backed SSE streams can be cancelled promptly by the client cancellation callback without relying on server closure.
  • Ensure JSON-RPC SSE streams use unique request IDs and that cross-stream response IDs are rejected exactly once.
  • Verify no observer callbacks occur after a StreamHandle has been destroyed and returned.

Description

  • Add a deterministic loopback SSE server and cancellable invocation helper, and test that flipping the is_cancelled callback stops a2a::http::Client::StreamRequest() promptly and prevents delivery of later chunks (tests/unit/http_client_test.cpp).
  • Add controlled JSON-RPC streaming harness that captures request envelopes, generates sequential request IDs, verifies distinct IDs per stream, rejects cross-stream responses with a single protocol error, and accepts matching responses (tests/unit/json_rpc_transport_test.cpp).
  • Add a late-callback requester and a test that destroys an active StreamHandle then lets the requester attempt a late event to confirm no observer callbacks happen after destruction returns (tests/unit/stream_handle_lifecycle_test.cpp).
  • Use bounded waits and synchronization primitives (std::condition_variable, std::atomic, std::future) instead of sleeps, and tidy up small return/value style issues to satisfy linters.

@MisterVVP MisterVVP added the codex Automatic label added by codex agent. Should not be used label Jul 16, 2026 — with ChatGPT Codex Connector
@MisterVVP MisterVVP added AI agent AI agent contribution and removed codex Automatic label added by codex agent. Should not be used labels Jul 16, 2026
@MisterVVP
MisterVVP merged commit d71f968 into dev-add-sse-streaming-support-to-clients Jul 16, 2026
15 checks passed
@MisterVVP
MisterVVP deleted the dev-add-tests-for-libcurl-stream-cancellation branch July 16, 2026 17:17
MisterVVP added a commit that referenced this pull request Jul 19, 2026
…ests (#153)

### Motivation
- Prove libcurl-backed SSE streams can be cancelled promptly by the
client cancellation callback without relying on server closure.
- Ensure JSON-RPC SSE streams use unique request IDs and that
cross-stream response IDs are rejected exactly once.
- Verify no observer callbacks occur after a `StreamHandle` has been
destroyed and returned.

### Description
- Add a deterministic loopback SSE server and cancellable invocation
helper, and test that flipping the `is_cancelled` callback stops
`a2a::http::Client::StreamRequest()` promptly and prevents delivery of
later chunks (`tests/unit/http_client_test.cpp`).
- Add controlled JSON-RPC streaming harness that captures request
envelopes, generates sequential request IDs, verifies distinct IDs per
stream, rejects cross-stream responses with a single protocol error, and
accepts matching responses (`tests/unit/json_rpc_transport_test.cpp`).
- Add a late-callback requester and a test that destroys an active
`StreamHandle` then lets the requester attempt a late event to confirm
no observer callbacks happen after destruction returns
(`tests/unit/stream_handle_lifecycle_test.cpp`).
- Use bounded waits and synchronization primitives
(`std::condition_variable`, `std::atomic`, `std::future`) instead of
sleeps, and tidy up small return/value style issues to satisfy linters.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI agent AI agent contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant