Skip to content

fix(http): propagate invalid JSON from inline POST responses - #201

Open
lj1166 wants to merge 1 commit into
agentclientprotocol:mainfrom
lj1166:fix/http-post-json-errors
Open

lj1166 wants to merge 1 commit into
agentclientprotocol:mainfrom
lj1166:fix/http-post-json-errors

Conversation

@lj1166

@lj1166 lj1166 commented Nov 18, 2026

Copy link
Copy Markdown

Summary

Propagate invalid JSON from non-empty HTTP 200 POST responses instead of swallowing it and leaving Connection.send_request() waiting indefinitely. The existing send-failure cleanup rejects the affected request; the connection can serve a subsequent valid response.

Remove the broad suppression, add two request/recovery regressions, and document the error behavior. No schema, dependency or public-signature changes.

Related issues

Fixes #200.

Testing

Locked environment: CPython 3.12.16, Windows/amd64, httpx2 2.12.0.

  • Before: both new malformed-body cases time out; three selected existing controls pass.
  • After: tests/http/test_http_client.py — 15 passed. Tests use real Connection/HTTP transport code and the existing fake HTTP server.
  • Full pytest --doctest-modules: 540 passed, 2 skipped, 1 failed. The failure is the existing Windows CRLF length assertion in test_spawn_stdio_transport_custom_limit_handles_large_line, reproduced on clean main 4fed584.
  • All 10 prek hooks, Ruff, deptry, lock consistency, changed-file ty and strict MkDocs build: pass.
  • The Makefile's full ty command reports two existing unresolved hypercorn imports in examples/http_server.py; both reproduce in the clean main worktree. No new diagnostics.

Docs & screenshots

Added a note to the web-transport client documentation. No UI changes.

AI assistance: Codex found this during source review, prepared/reviewed the patch and ran the checks under the account holder's instruction. A production incident or independent human verification is not claimed.

Checklist

  • Conventional Commit title.
  • Tests cover the change.
  • Docs/examples updated when behaviour is user-facing.
  • No schema regeneration.

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.

bug: invalid inline HTTP POST JSON leaves requests waiting

1 participant