Skip to content

fix(http): deliver queued upgrades before earlier responses finish - #68

Merged
steipete merged 3 commits into
mainfrom
claude/w63-queued-upgrade
Oct 2, 2026
Merged

steipete merged 3 commits into
mainfrom
claude/w63-queued-upgrade

Conversation

@steipete

@steipete steipete commented Oct 2, 2026 •

Copy link
Copy Markdown

An Upgrade request pipelined behind an unfinished HTTP response was dispatched as a normal request. This deadlocked applications whose upgrade listener finishes the response ahead of it.

Emit upgrade immediately for queued requests, and retain that request's native context and socket handle. Built-in WebSocket adoption waits until the HTTP response pipeline reaches the handoff, then runs on a fresh turn so it cannot replace a socket inside the previous response's native callback. The fork's existing raw-write buffering and pause/resume paths remain in use.

Adapts the dispatch/adoption portions of the open upstream oven-sh#43441 by @robobun. The fork already has the relevant CONNECT and ordered raw-write machinery, so it does not need the upstream transport rewrite. Raw handshake rejection remains immediate, matching the executed Node 24 + npm ws oracle; the negative regressions pin that behavior.

Validation: the standalone queued-upgrade repro passes Node 24, times out on the verified b368 baseline, and passes the candidate with 200 then 101 on the wire. All four new native/npm ws acceptance and rejection regressions fail on b368 and pass after. The surrounding HTTP, CONNECT, WebSocket, pause and socket-end/drain suites pass: 441 passed, 1 skipped, 2 existing todos. The unchanged OpenClaw rejection-transport consumer passes all 18 tests on Linux and Darwin with private HOME/state/TMPDIR; its three queued-upgrade cases failed before. The four native regressions also pass on Darwin, and all 12 cross-target Rust checks pass. Scoped-clean P2 Codex branch review and exact-head build/format/lint gates are required before merge.

@autofix-troubleshooter

Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃

@steipete
steipete force-pushed the claude/w63-queued-upgrade branch from 31d2839 to 2cd134f Compare October 2, 2026 04:44
@steipete
steipete merged commit b21bb89 into main Oct 2, 2026
10 checks passed
@steipete
steipete deleted the claude/w63-queued-upgrade branch October 2, 2026 04:51
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.

2 participants