Repository navigation
fix(web-fetch): release unread responses after provider fallback - #115759
Merged
Merged
Conversation
Co-authored-by: NIO <[email protected]>
steipete
force-pushed
the
codex/s16-web-fetch-fallback-lifecycle
branch
from
July 29, 2026 08:36
095f998 to
232b6ac
Compare
Contributor
Author
|
Merged via squash.
|
3 tasks done
pull Bot
pushed a commit
to yann0001/openclaw
that referenced
this pull request
Jul 29, 2026
* origin/main: fix(gateway): keep Responses replacement streams consistent (openclaw#115799) fix(gateway): hosted setup exits no longer stop the gateway (openclaw#115671) fix(cron): protect sessions throughout model preparation (openclaw#115804) fix(ui): preserve model names alongside aliases (openclaw#115789) fix(qa): prepare shared Slack live flows fix(ui): stabilize memory engine selection (openclaw#115750) fix(web-fetch): release abandoned fallback response bodies (openclaw#115759)
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
…115759) Co-authored-by: NIO <[email protected]>
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
* origin/main: fix(gateway): keep Responses replacement streams consistent (openclaw#115799) fix(gateway): hosted setup exits no longer stop the gateway (openclaw#115671) fix(cron): protect sessions throughout model preparation (openclaw#115804) fix(ui): preserve model names alongside aliases (openclaw#115789) fix(qa): prepare shared Slack live flows fix(ui): stabilize memory engine selection (openclaw#115750) fix(web-fetch): release abandoned fallback response bodies (openclaw#115759)
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.
Related: #111332
What Problem This Solves
Fixes an issue where users relying on a configured web-fetch provider fallback could leak upstream HTTP connections whenever a direct fetch returned an unread error response. A successful fallback returned to the agent while the original response kept streaming; a provider failure leaked the same response while propagating the error.
Why This Change Was Made
Cancel an upstream response exactly once in the existing guarded-fetch cleanup when its body remains unread. Start cancellation before releasing the network guard without awaiting it, so a noncompliant never-settling stream cannot block a successful fallback. Already-consumed HTML/readability responses, provider selection and cache behavior, original provider errors, and private-network/SSRF policy remain unchanged.
This is a trusted-main, smaller and more complete follow-up to @nocodet888-arch's original #111332. The original contributor is credited as a commit co-author.
User Impact
Provider fallback no longer leaves HTTP streams or sockets open, including when the provider itself fails. Long-running agents retain bounded HTTP resources without weakening web-fetch SSRF protection or introducing configuration.
Evidence
pnpm check:changedpassed on the exact final patch, including formatting, core/core-test typechecks, lint, dead-export, SDK/boundary, and repository guards.gpt-5.6-solxhigh autoreview: clean, 0.98 confidence.blacksmith-testbox, final command exit 0; lease stopped after proof.