Repository navigation
fix(runtime): report interrupted requests - #416
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the shared-runtime and Serverless interruption-handling changes.
No open issues 🎉
What changed in this PR
Fixes interrupted request reporting in the SDK’s shared runtime and Serverless transport for the planned 0.11.0 release, preventing callers from waiting indefinitely or receiving a misleading successful completion.
Changes:
- Handles uncaught
gevent.TimeoutandGreenletExitat the shared request boundary. - Propagates Serverless task cancellation when the response remains open.
- Adds interruption and worker-reuse regression tests, plus release documentation.
| File | Description |
|---|---|
tests/servers/test_io_server.py |
Tests interruption reporting, error details, cleanup, and worker reuse. |
src/dify_plugin/core/server/serverless/response_writer.py |
Propagates GreenletExit results while the response is open. |
src/dify_plugin/core/server/io_server.py |
Includes timeouts and greenlet cancellation in request error handling. |
README.md |
Documents interruption behavior for SDK 0.11.0. |
Review effort: Balanced
WH-2099
enabled auto-merge (squash)
November 2, 2026 04:34
hjlarry
approved these changes
Nov 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plugin requests interrupted by
gevent.TimeoutorGreenletExitcan finish without sending sessionerrorandendframes, leaving the caller waiting.Serverless also treats
GreenletExitas a successful task result and can send a misleadingendwithout an error.Handle these interruptions at the shared request boundary, and propagate a Serverless task's
GreenletExitwhen its response is still open.Errors preserve their original type, message, and traceback; request finalization releases the worker for the next request.
The existing client-disconnect cancellation tests continue to pass.
Remove the redundant README sections for HTTP error responses, request interruption, and agent token estimates.
Target release: SDK 0.11.0.
Refs #413.
Compatibility check
Validation
just checkpassed.just test --cov --cov-report=json:reports/coverage.json --cov-report=term-missing:skip-coveredpassed: 1,815 tests on Python 3.12.just buildpassed for the 0.11.0 wheel and source distribution.Live deployment validation is still pending.