Title: bug: invalid inline HTTP POST JSON leaves requests waiting · Issue #200 · agentclientprotocol/python-sdk · GitHub
Open Graph Title: bug: invalid inline HTTP POST JSON leaves requests waiting · Issue #200 · agentclientprotocol/python-sdk
X Title: bug: invalid inline HTTP POST JSON leaves requests waiting · Issue #200 · agentclientprotocol/python-sdk
Description: Summary The HTTP transport silently ignores JSON decoding failures in non-empty 200 OK POST responses. Connection.send_request() then keeps waiting on its pending future, although the HTTP response has already arrived and cannot be decod...
Open Graph Description: Summary The HTTP transport silently ignores JSON decoding failures in non-empty 200 OK POST responses. Connection.send_request() then keeps waiting on its pending future, although the HTTP response...
X Description: Summary The HTTP transport silently ignores JSON decoding failures in non-empty 200 OK POST responses. Connection.send_request() then keeps waiting on its pending future, although the HTTP response...
Opengraph URL: https://github.com/agentclientprotocol/python-sdk/issues/200
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: invalid inline HTTP POST JSON leaves requests waiting","articleBody":"## Summary\n\nThe HTTP transport silently ignores JSON decoding failures in non-empty `200 OK` POST responses. `Connection.send_request()` then keeps waiting on its pending future, although the HTTP response has already arrived and cannot be decoded.\n\nFor example, a proxy returning an HTML error page with status 200 hides the useful decoding error behind a later timeout (or waits indefinitely without a caller timeout).\n\n## Reproduction steps\n\nUsing `create_http_stream()` and `Connection`:\n\n1. Initialize normally and leave the connection-scoped SSE stream open.\n2. Return HTTP 200 with body `\u003chtml>not an ACP response\u003c/html>` (or `{invalid`) for the next POST.\n3. Await `connection.send_request(\"broken\", {})`.\n\nThe HTTP-only failure can also be seen directly: `await transport.send(request)` returns successfully after receiving that body. `_send_post()` wraps both `response.json()` and `_handle_incoming()` in `contextlib.suppress(Exception)`.\n\nI reproduced this with two regression cases using the existing `FakeServer`, the real HTTP transport and `Connection`; only HTTP delivery uses `httpx2.MockTransport`. Each case expects `json.JSONDecodeError` from the request within one second, and checks that a subsequent valid inline response still succeeds. Both fail before the patch; the three selected initialization, SSE-delivery and status-error controls pass.\n\n## Expected result\n\nThe sending caller gets the decoding error promptly and can diagnose the bad response. A later valid request can still use the connection.\n\n## Actual result\n\nBoth cases reach the outer one-second `asyncio.wait_for()` deadline and raise `TimeoutError`. The original JSON decoding error has been discarded.\n\n## Versions / environment\n\n- SDK 0.12.1, main `4fed584775d6a650cd669b63617049e5352297fe`\n- Generated schema tag `schema-v1.23.0`\n- CPython 3.12.16, Windows/amd64, locked httpx2 2.12.0 and Pydantic 2.14.1\n- Offline regression; no model, credentials or external server\n\n## Logs\n\n```text\nFAILED test_invalid_post_json_rejects_request_without_losing_connection[\u003chtml>not an ACP response\u003c/html>]\nFAILED test_invalid_post_json_rejects_request_without_losing_connection[{invalid]\n2 failed, 3 passed, 10 deselected\n```\n\n## Open to submitting a fix?\n\nYes. Removing the broad suppression makes the existing request-failure cleanup propagate the JSON error; the related test file then has 15 passing tests. I also added a short transport documentation note.\n\nSearched existing issues/PRs for HTTP JSON, malformed POST, response.json and 200/hang. #174 concerns malformed incoming frames across transports; this is the separate inline POST-response path.\n\nAI disclosure: Codex found this through source review, ran the reproductions and drafted the patch/report under the account holder's instruction. The proxy example describes the failure scenario; a production incident or independent human verification is not claimed.\n","author":{"url":"https://github.com/lj1166","@type":"Person","name":"lj1166"},"datePublished":"2026-11-18T09:42:56Z","url":"https://github.com/agentclientprotocol/python-sdk/issues/200"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e2e6d4fc-e324-aca8-3224-3c057ddc2485 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9AF6:225B46:E2A675:137A99B:6B045FFB |
| html-safe-nonce | ba00d399b5d410a22df219e375d2d4fab4e4f187f1974032fbe1a2db334452f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUY2OjIyNUI0NjpFMkE2NzU6MTM3QTk5Qjo2QjA0NUZGQiIsInZpc2l0b3JfaWQiOiIyNDgxNjQxODg5MzU5NzQ5MTE1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 376fc626c3a2fb09ba32b7517f16efeb28144295730feb88f8f7091aa7aad600 |
| hovercard-subject-tag | issue:6464280654 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/agentclientprotocol/python-sdk/200/issue_layout |
| twitter:image | https://opengraph.githubassets.com/32251d9ed44ca30fb59128f7b2af4b92cf83b26fd7ef7f9d36b49ba810c77300/agentclientprotocol/python-sdk/issues/200 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/32251d9ed44ca30fb59128f7b2af4b92cf83b26fd7ef7f9d36b49ba810c77300/agentclientprotocol/python-sdk/issues/200 |
| og:image:alt | Summary The HTTP transport silently ignores JSON decoding failures in non-empty 200 OK POST responses. Connection.send_request() then keeps waiting on its pending future, although the HTTP response... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lj1166 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2d58451b4bcb73c33c67bfb6b28fb75fe6d5e279daf9b560fa4fd832f3d8c9a6 |
| turbo-cache-control | no-preview |
| go-import | github.com/agentclientprotocol/python-sdk git https://github.com/agentclientprotocol/python-sdk.git |
| octolytics-dimension-user_id | 235308037 |
| octolytics-dimension-user_login | agentclientprotocol |
| octolytics-dimension-repository_id | 1051445009 |
| octolytics-dimension-repository_nwo | agentclientprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1051445009 |
| octolytics-dimension-repository_network_root_nwo | agentclientprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 03e114520787ad27289207f153520ef97461127c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width