Skip to content

Claude picker relay: HTTP/1.1 refusal of an unfinished upload hangs (Bun 1.4.2) or resets (Bun 1.4.3) #6984

Closed

Description

@lidge-jun

Client or integration

Other

Area

Proxy and routing

Summary

The Claude Desktop picker relay (src/claude/intercept/picker-listener.ts) does not deliver an HTTP/1.1 refusal (400/503) cleanly when the client is still uploading a body, on the shipped Bun 1.4.2 runtime and on Bun 1.4.3. The reply should arrive with Connection: close and the connection should then close.

  • Bun 1.4.0: works (claude-picker-upload h1 buffered refusal cases pass 12/12).
  • Bun 1.4.2 (shipped runtime): the empty refusal and TLS EOF reach the client, but the TCP front stops draining the abandoned upload after the backend ends, so the connection never closes (test hits its 4 s deadline 12/12; an independent Node v24 HTTPS client hangs the same way).
  • Bun 1.4.3: Bun's HTTP server now ends a Connection: close response with socket.destroySoon() (node:http: the server follows Node (request body, framing, response finish, lifecycle) oven-sh/bun#43557) before the listener's finish handler runs; the splice is torn down before the reply reaches the client, which sees read ECONNRESET (10/12).

HTTP/2 requests (Desktop's normal path) are unaffected. Desktop's HTTP/1.1 fallback can plausibly hit it; that is inferred, not reproduced in the app.

Reproduction

  1. bun test --isolate tests/claude-integration/claude-picker-upload.test.ts -t 'h1.*buffered upload' on Bun 1.4.2 or 1.4.3 (macOS arm64; also hosted Linux and macOS on 1.4.3 in run 38219557150).
  2. Observe "h1 400/503 refusal closes a buffered upload without body completion" fail: a 4 s close wait on 1.4.2, ECONNRESET before the reply on 1.4.3.

Found while moving CI's test runner from Bun 1.4.0 to 1.4.3 for #4956.

Version

2.84.0 (dev a0191a1)

Operating system

macOS 26 (arm64); Ubuntu 24.04 and macOS GitHub runners

Provider and model

No response

Logs or error output

1.4.3: error: read ECONNRESET (errno -54, syscall read)
(fail) h1 503 refusal closes a buffered upload without body completion [7.03ms]
1.4.2: (fail) h1 400 refusal closes a buffered upload without body completion [4003.26ms]

Screenshots and supporting files

No response

Redacted configuration

No response

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    on Oct 12, 2026
  2. added
    proxy
    on Oct 12, 2026
  3. Ingwannu commented on Oct 12, 2026

    @Ingwannu
    Owner

    Independent check at trusted dev a0191a1b6fd921a6e5a9d12cb123c8df88b023e7: the existing two h1.*refusal closes a buffered upload cases passed on this Linux x86_64 host with Bun 1.4.2 (744846f84), 2 pass / 0 fail / 8 assertions. The local CA, upstream and clients were synthetic loopback fixtures; no Desktop, provider or live interception configuration was used. Hard cgroup CPU 75%, memory high/max 1280/1536 MiB, swap 0, tasks 64, finite 45-second cap, disposable private homes; protected files unchanged.

    This does not contradict your macOS arm64 1.4.2 observations or the reported 1.4.3 hosted failures, and it is not a fix. It narrows the current independent receipt: Linux 1.4.2 did not reproduce in this single two-case run; 1.4.3 and Desktop fallback were not tested here. The production front does currently couple backend close to the spliced client and only resumes discarded input in the response-finish path, so the EOF/drain/finish ordering remains the useful failure boundary.

    Please keep this issue open and preserve an exact-head macOS/1.4.3 failing receipt when proposing a change, with assertions for reply status/Connection header, socket close and unaffected h2/keep-alive behavior. Increasing the close wait or treating an ECONNRESET as successful delivery would not meet that contract.

  4. lidge-jun commented on Oct 12, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #6986 (commit 95bee2781f), landed through #7009 (merge 8f10f238e3). Ships in 2.84.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugproxy

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions