Skip to content

fix(sdk): close abandoned SSE responses when a watcher stops - #4246

Merged
ScriptedAlchemy merged 2 commits into
masterfrom
fix/4209-sdk-stream-disposal
Oct 18, 2026
Merged

ScriptedAlchemy merged 2 commits into
masterfrom
fix/4209-sdk-stream-disposal

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fixes #4209.

streamOperation owns its HTTP response through validation, parsing, terminal completion, and iterator disposal. Ending a watch closes the response body but never posts an application cancellation request. Cleanup preserves an existing protocol, abort, or transport failure; if otherwise successful disposal cannot close the underlying transport, it returns a typed TraceDecayDisconnectedError with that cause instead of silently succeeding.

The generated plugin/chatgpt-extension/embedded/server.mjs is rebuilt and committed. Temporary owner-scoped repair/generation steps were removed afterward: the existing Renovate workflow is restored byte-for-byte, with no net workflow change.

Verified behavior

Cleanup regression and build run:

  • The new early-return and consumer-break cases both failed before the cleanup-error fix. The two original-error-preservation cases passed.
  • With the reviewed source change applied, all 45 SDK tests passed, including those four cases and the real loopback HTTP watcher test.
  • SDK typecheck, SDK build, ChatGPT extension build, check:embedded, and git diff --check: passed.
  • The tested source and generated artifact were committed together as 5a173fba2ff4276abacbce396b16dd63c8e89ef0; the following commit only restores the temporary workflow.

The SDK command excludes the existing installed-package test; it is not included in the 45-test claim. Full ready-PR CI runs separately and must satisfy repository merge requirements. Earlier draft-only green runs skipped heavy jobs and are not full validation.

Related #4210 (reconnect policy), #4211 (terminal classification), and #4226 (napi-rs consolidation) remain separate.

@changeset-bot

changeset-bot Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 1a88a1e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration[bot]

This comment was marked as resolved.

@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/4209-sdk-stream-disposal branch from 364b9d0 to 4abc5af Compare October 18, 2026 05:57
Own each response through stream validation and iterator disposal.
Preserve original failures and report otherwise failed transport cleanup.
Include lifecycle regressions and regenerated extension artifacts.

Fixes #4209
@ScriptedAlchemy
ScriptedAlchemy force-pushed the fix/4209-sdk-stream-disposal branch from 4abc5af to 0b7c2f6 Compare October 18, 2026 06:05

Copy link
Copy Markdown
Owner Author

Rewrote the complete PR history with the owner's authorization: 8 commits are now one, 0b7c2f653bc9ddc30f15867b51c9ae8ab2ca4815 (fix(sdk): close abandoned operation streams). This removes the overlong ancestor messages as well as the already-corrected tip message.

The new commit reuses the exact prior root tree 09c643974f1530698429f8eb913391470665e510 and original parent 654b8e65df2994c19c0109c3e17f93f6a3909f39. Source, tests, generated artifacts, file modes, and the final workflow content are unchanged. The branch update used an expected-head lease; no update to master or commitlint policy was made.

Fresh checks must be evaluated against the new head. Correction to the earlier chat update: the main run examined at 364b9d0 failed commit lint and skipped its dependent implementation jobs; it did not demonstrate a full Linux/Clippy/Dashboard/shipped-build pass. The focused SDK and bundle verification linked in the PR description remains separate evidence.

@ScriptedAlchemy
ScriptedAlchemy merged commit 0fa6ce8 into master Oct 18, 2026
12 of 22 checks passed
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.

Cancel the TypeScript SDK response body when an operation stream iterator is closed

1 participant