fix(stdio): drain accepted responses before EOF shutdown - #3421
fix(stdio): drain accepted responses before EOF shutdown#3421ace-trump-tech wants to merge 1 commit into
Conversation
Signed-off-by: ace-trump-tech <ace-trump-tech@users.noreply.github.com>
|
This PR has been closed automatically. This repo only keeps pull requests open when they come from a maintainer, or from a contributor a maintainer has assigned to the linked issue, and you aren't currently assigned to #2678. If a maintainer assigns you to #2678, this PR reopens on its own and there's nothing more you need to do here. Assignment is a maintainer call based on capacity; comments that only ask to be assigned don't factor in. What does help is engaging on the issue itself by confirming the repro, explaining why it matters for your use case, or describing the approach you'd take. You're welcome to keep pushing commits here (just avoid force-pushing, since GitHub can't reopen a rewritten branch), but that on its own won't get the PR reviewed or the issue assigned, and realistically most auto-closed PRs stay closed. There's no need to open a new PR either way. CONTRIBUTING.md has the full reasoning, but in short:
Maintainers: reopen, remove |
Fixes #2678
Summary
Ensure that accepted stdio requests complete and their JSON-RPC responses are
written before the server shuts down after stdin reaches EOF.
Motivation and Context
When a stdio server receives JSONL input through shell redirection, stdin may
reach EOF while one or more accepted request handlers are still running. The
current shutdown path can cancel those handlers before their responses are
flushed to stdout.
As a result, the final tool-call responses may disappear silently, even though
the requests were accepted and processed.
This change adds a bounded graceful-shutdown drain for active requests. The
default behavior remains unchanged for transports that do not opt into the
drain window.
How Has This Been Tested?
Environment:
Breaking Changes
No breaking changes. The graceful-shutdown drain is bounded and opt-in. Existing
behavior for other transports remains unchanged.
Types of changes
Checklist
help wanted, or I'm a maintainer)Additional context
The implementation is available in:
https://github.com/ace-trump-tech/python-sdk/tree/fix/stdio-eof-drain