Skip to content

fix(http): abort unfinished responses without sending success - #47

Merged
steipete merged 2 commits into
mainfrom
claude/fix-http-asynchronous-abort
Oct 1, 2026
Merged

steipete merged 2 commits into
mainfrom
claude/fix-http-asynchronous-abort

Conversation

@steipete

@steipete steipete commented Sep 30, 2026 •

Copy link
Copy Markdown

Close an unfinished HTTP connection when its request or response is destroyed asynchronously. The native abort path previously called end_without_body(true), which could send an empty 200 response instead of aborting the exchange.

Abort now delegates to the existing native HTTP socket owner. That keeps its partial-write flushing, parser-aware close, TLS shutdown, and queued-response ownership. Pending pinned writes and request references are released without marking an HTTP response successfully complete. The JS socket wrapper defers its already-closed callback through the native immediate scheduler while retaining ownership of the captured callback; this preserves Node event ordering and completion when native close notification re-enters destruction.

Validation on macOS arm64:

  • New regression matrix: the unpatched fork passes 14 and fails five cases; the patched build passes all 19. The same 18-case abort probe and four-request pipelining probe match Node 24.
  • Complete abort, HTTP, backpressure, and response-leak suites: 490 passed, one existing skip, zero failures. Includes full delivery of an already-written 64 MiB body before close, pending-write failures, paused request bodies, TLS, peer resets, and GC during pipelined teardown.
  • rust:check-all: all 12 targets pass, with no skips. Source type checking, JS lint, and formatting pass.
  • Independent review reports no actionable P0–P2 findings. All six OpenClaw consumer files fail on the baseline and pass with the final binary, using the same checkout and private home/state/temp directories.

Upstream PR/issue searches found no exact asynchronous-empty-200 fix. No upstream patch was copied.

Consumer results:

File Before After
src/gateway/worker-environments/node-workspace-transfer-pack.test.ts failed passed (5 tests)
src/gateway/watch-node-http.test.ts failed passed (21 tests)
src/gateway/worker-environments/node-workspace-transfer-revocation.test.ts failed passed (26 tests)
src/gateway/server.portals.session.test.ts failed passed (1 tests)
extensions/feishu/src/monitor.webhook-routing.test.ts failed passed (9 tests)
extensions/msteams/src/monitor.webhook-lifecycle.test.ts failed passed (19 tests)

@steipete
steipete marked this pull request as ready for review September 30, 2026 12:19
@steipete
steipete force-pushed the claude/fix-http-asynchronous-abort branch from 40ad360 to 51eb3fe Compare October 1, 2026 06:11
@steipete
steipete merged commit bc543c8 into main Oct 1, 2026
10 checks passed
@steipete
steipete deleted the claude/fix-http-asynchronous-abort branch October 1, 2026 06:22
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