Files
Claude b4edbd4bb7 fix(client): harden the resumption GET and SSE POST error paths per review
Address the review findings on the previous revision:

- Dispatch resumption on message type as well as metadata: a notification
  stamped with a resumption token is POSTed as usual instead of tripping
  the resumption path's request-only assertion and killing the write loop.
- Treat any non-2xx as a failure (response.is_success), restoring the
  raise_for_status() semantics the checks replaced: an unfollowed redirect
  resolves the caller instead of being logged as success.
- Map a 404 on the resumption GET while a session id is held to
  INVALID_REQUEST / "Session terminated", the POST path's session-expiry
  signal, so reconnect logic keyed on it works across both.
- Contain the resumption read loop like _handle_sse_response: a stream
  dying mid-read or ending cleanly without a response resolves the waiter
  (CONNECTION_CLOSED) instead of tearing down the transport or hanging.
- Resolve the resumption GET's status errors via _resolve_abandoned_request
  for its closed-stream containment instead of hand-building the error.
- Surface network-level errors (httpx.HTTPError) on the SSE message POST
  through the same correlated path: on this transport nothing escapes
  loudly, so the caller previously hung forever.
- Deduplicate the SSE test app wiring behind make_app(wrap_post=...).

Seven new regression tests pin the above; each fails against the previous
revision (hang into fail_after, transport teardown, or wrong error).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AuJi8kEB3bhikW2pzbmhUL
2026-08-11 05:56:37 +00:00
..
2024-09-24 22:04:19 +01:00