Title: fix(stdio): settle writer close and disconnection by Elon-Jiang · Pull Request #199 · agentclientprotocol/python-sdk · GitHub
Open Graph Title: fix(stdio): settle writer close and disconnection by Elon-Jiang · Pull Request #199 · agentclientprotocol/python-sdk
X Title: fix(stdio): settle writer close and disconnection by Elon-Jiang · Pull Request #199 · agentclientprotocol/python-sdk
Description: Summary The StreamWriter returned by stdio_streams() cannot complete normal wait_closed() calls (_get_close_waiter is missing). If stdout is backpressured when its reader disconnects, drain() never wakes because the protocol ignores connection_lost. The Windows stdout adapter also logs write failures but leaves the writer apparently usable. Use asyncio's existing flow-control implementation, add the writer's close waiter, and notify the same protocol when the Windows adapter closes or fails a write. Pending sends now fail on disconnection and normal buffered output can close cleanly. No public signatures, schema, or dependencies change. Related issues Found through the public stdio API on main 4fed584775d6a650cd669b63617049e5352297fe. This is separate from subprocess-stdin shutdown (#152) and the original Windows pipe setup report (#3); neither supplies this writer's missing close/error lifecycle. Testing The new four-case regression fails on unchanged main: normal POSIX and Windows-adapter close raise AttributeError; POSIX drain() times out under reader closure; the Windows adapter does not report its write error. pytest tests/real_user/test_stdio_writer.py tests/real_user/test_stdio_limits.py tests/real_user/test_stdio_shutdown.py -q: 12 passed. make check: passed (locked dependencies, actual prek checks, ty, deptry). NO_PROXY=localhost,127.0.0.1,::1 no_proxy=localhost,127.0.0.1,::1 make test: 544 passed, 1 skipped (optional Gemini), with one code-generation warning in unchanged code. The per-command loopback override allows the existing native WebSocket tests to bypass this machine's SOCKS proxy. The POSIX tests use real subprocess stdio pipes, including 1 MiB buffered output and closing the actual receiving pipe. The Windows-specific adapter is exercised via the public stdio_streams() entry point with controlled standard handles on macOS; no native Windows execution is claimed. Docs & screenshots Expanded the public stdio_streams docstring to describe close/wait_closed and disconnection errors. No UI changes or schema regeneration. Checklist Conventional Commit title. Tests cover the change. Public docstring updated. No schema regeneration needed. AI assistance was used for investigation, implementation and local verification; no human review is claimed.
Open Graph Description: Summary The StreamWriter returned by stdio_streams() cannot complete normal wait_closed() calls (_get_close_waiter is missing). If stdout is backpressured when its reader disconnects, drain() never...
X Description: Summary The StreamWriter returned by stdio_streams() cannot complete normal wait_closed() calls (_get_close_waiter is missing). If stdout is backpressured when its reader disconnects, drain() never...
Opengraph URL: https://github.com/agentclientprotocol/python-sdk/pull/199
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
| 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 | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:abd5ea3c-f957-6326-8608-a74145bcbe08 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 990C:2D066D:132AF6:1A5B04:6B0464ED |
| html-safe-nonce | b03007bb32f07c28e548dc235be312dd9a70478e0603aa04338fe90d02cf11b5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTBDOjJEMDY2RDoxMzJBRjY6MUE1QjA0OjZCMDQ2NEVEIiwidmlzaXRvcl9pZCI6IjEyMzY5MDg1MDA5NTM4ODM4ODUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0cb11a798c30c2c20abc796eae3a90bf6685cb1f405b6e0a2dda337488d023bc |
| hovercard-subject-tag | pull_request:5354015011 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/agentclientprotocol/python-sdk/pull/199/files |
| twitter:image | https://avatars.githubusercontent.com/u/191222665?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/191222665?s=400&v=4 |
| og:image:alt | Summary The StreamWriter returned by stdio_streams() cannot complete normal wait_closed() calls (_get_close_waiter is missing). If stdout is backpressured when its reader disconnects, drain() never... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | no-cache |
Viewport: width=device-width