Skip to content

fix: bound stdin closure during subprocess shutdown - #152

Open
Oscar-Williams wants to merge 1 commit into
agentclientprotocol:mainfrom
Oscar-Williams:fix-stdio-shutdown-timeout
Open

Oscar-Williams wants to merge 1 commit into
agentclientprotocol:mainfrom
Oscar-Williams:fix-stdio-shutdown-timeout

Conversation

@Oscar-Williams

Copy link
Copy Markdown

Summary

When a child stops reading stdin with buffered input pending, spawn_stdio_transport can hang before reaching its process-exit timeout. Close stdin and bound wait_closed() with shutdown_timeout, allowing the existing terminate/kill fallback to run while preserving graceful flushing.

Related issues

Applies the bounded stdin cleanup used by the Gemini example in #103 to the public transport helper.

Testing

  • Linux / Python 3.14: same real-subprocess tests fail twice on base and pass all 5 cases with the fix; covers terminate, kill, full input delivery, body exceptions and an exited child.
  • make test: 362 passed, 1 skipped (optional Gemini CLI).
  • make check and make docs-test: passed.
  • Windows / Python 3.11: 4 passed, 1 skipped in the new tests. The adjacent large-line test has an existing CRLF assertion failure on both base and head.

Docs & screenshots

Clarified timeout behavior in the function docstring. No UI or schema changes.

Checklist

  • Conventional Commit title (e.g. feat:, fix:).
  • Tests cover the change or are not required (explain above).
  • Docs/examples updated when behaviour is user-facing.
  • Schema regenerations (make gen-all) are called out if applicable.

The author set the contribution scope and validation requirements; Codex assisted with implementation and automated testing.

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.

1 participant