GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang · Issue #2847 · developing-today/code

proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847

New issue
Copy link
New issue
Copy link
Closed
#4437
Closed
proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang#2847
#4437
Copy link
Assignees
dezren39
Labels
app/proxy-relaybin/proxy-relay.mjs sandbox-to-laptop relayeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 30, 2026
Issue body actions

Summary

bin/proxy-relay.mjs silently drops every byte a client sends after the first TCP chunk until the upstream tunnel connection is established. The relay peeks at the first request line, removes its only data listener, then spends 0.1s–10s in tryTargets()/connectViaTunnel() before piping — and the client socket is never paused, so any bytes the client sends in that window (request bodies, the tail of a large header block) are read off the socket and discarded. The forwarded request therefore arrives truncated: a Content-Length: 1000 POST reaches the upstream with only the headers, and the upstream hangs waiting for a body that will never come (or, for chunked/pipelined traffic, desynchronizes).

Evidence (verified this run, main 497c820f)

bin/proxy-relay.mjs:

  • L152–187 (server handler): client.on('data', onData); inside onData, once the first \r\n is seen, client.removeListener('data', onData) runs, then tryTargets(order).then((upstream) => { upstream.write(buf); client.pipe(upstream); ... }). Nothing calls client.pause() between the listener removal and the .then, and no buffering listener replaces onData.
  • L93: the tunnel CONNECT carries a 10s timeout; the header comment (L14–15) measures refused CONNECTs at ~0.1–0.5s — the loss window is at least that long on every connection whose first target does not answer instantly, and on the first connection to any target.

Probe (laptop, ~/git/fleet/probe-2026-10-30-laneA-relaypeek/probe.mjs): the peek handler copied in structure verbatim, with tryTargets stubbed to a 400ms delay (inside the measured CONNECT window) in front of a recording sink. The client sent the 56-byte header block, then 10×100 body bytes at 30ms intervals — all inside the gap. Two consecutive runs:

{"expected":1056,"sinkReceived":56,"lost":1000}
{"expected":1056,"sinkReceived":56,"lost":1000}

Only the peeked first chunk reached the sink; 100% of the bytes sent during the connect window were lost, deterministically.

Why real traffic hits this: a client that fits its whole request in one segment is unaffected (that first chunk is buffered in buf), which is why the relay mostly appears to work. Anything larger — the LLM API request bodies this relay exists to forward to the laptop fleet proxies routinely exceed one segment, and clients stream them immediately after the headers instead of waiting — loses everything between the first chunk and the completed CONNECT.

Why it matters

Silent data corruption on a byte-forwarder whose whole contract is "pipe bytes untouched" (header comment, L11–12). The failure mode is a hang, not an error: the upstream waits for the rest of a body the relay already consumed and threw away, so users see stalled requests against a relay and backend that both look healthy (the local /health answer deliberately does not exercise this path).

Acceptance criteria

  • Bytes a client sends at any point after connecting — including during the upstream CONNECT window — are forwarded to the upstream byte-for-byte and in order (e.g. the client socket is paused while the peek/connect is in flight and resumed into the pipe, or a buffering listener keeps collecting until the pipe is established).
  • A regression test (this file currently has no proxy-relay.test.mjs sibling, unlike every other bin/*.mjs proxy) drives a relay-pattern server whose upstream connect is artificially delayed, sends headers plus body chunks during the delay, and asserts the sink receives the exact byte stream.
  • The local GET /health fast path and the preferred-target retry order behave exactly as before; a single-segment request is forwarded unchanged.

Dedup / relations

  • Distinct from proxy-relay: RELAY_TARGET_PORTS silently drops invalid entries and reinterprets non-literals — a typo'd target list starts a healthy relay with the wrong targets #1844 (RELAY_TARGET_PORTS parsing) and proxy-relay: accepted client connections have no timeout — an idle or partial-line client is held forever (only the upstream CONNECT is timed) #2234 (accepted connections have no timeout — an idle-client hold; this is live-client data loss). Neither covers the peek/connect window.
  • Found by: new-issue-creator-code-a, this run.

Activity

Next
  1. dezren39
    added
    queue/queuedHas a queued queue task
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    priority/normalOrdinary priority (the default)
    app/proxy-relaybin/proxy-relay.mjs sandbox-to-laptop relay
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    effort/sSmall: expected under 2 hours of work
    on Oct 30, 2026
  2. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job (lane A)
    • Session / ID: new-issue-creator-code-a, cron run 2026-10-30 17:05 CDT
    • Found via: filed this run
    • Task: Filed after verifying with a laptop probe (peek handler structure verbatim from bin/proxy-relay.mjs, main 497c820; tryTargets stubbed to a 400ms delay inside the measured CONNECT window) that bytes a client sends after the first chunk, while the tunnel CONNECT is in flight, are dropped 100% — the handler removes its only data listener and never pauses the client, so a Content-Length: 1000 POST arrived at the sink as the 56 header bytes only (2/2 runs).
    • Expectation: effort/s triage — pin the pause-vs-buffer fix shape, then route a small_fix packet; the regression test needs a new proxy-relay.test.mjs (none exists).
    • Links: probe laptop ~/git/fleet/probe-2026-10-30-laneA-relaypeek/; evidence in issue body.
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: OpenCode scheduled lane 2026-11-01; queue task 4005 (triage, attempt 1)
    • Found via: claimed from repo-health-code-pilot queue
    • Task: Revalidate proxy-relay peek/connect byte loss and pin a safe pause/buffer strategy, including sibling-forwarder audit.
  5. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Nov 1, 2026
  6. 80 remaining items

  7. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up + parked

    • Agent: repo-worker-code (OpenChamber scheduled lane)
    • Session / ID: queue task 5440
    • Fresh evidence: proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847 OPEN/assigned to dezren39; PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 OPEN/non-draft, Drew-authored, head 0530eb1 unchanged, modifies both scoped files (bin/proxy-relay.mjs, bin/proxy-relay.test.mjs).
    • Disposition: no branch/worktree created, no competing work. Parking 30 min on the same-file conflict.
    • Resume: after PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 merges/closes; refresh main and revalidate.
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane A shift
    • Session / ID: task 5440 (repo-queue-worker-shift, 2026-11-02 08:04 CST run)
    • Found via: queue claim · resume of conflict park
    • Task: Conflict revalidated fresh this run and it persists: PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 (for proxy-relay: accepted client connections have no timeout — an idle or partial-line client is held forever (only the upstream CONNECT is timed) #2234, branch queue/5230-2234-proxy-relay-first-line-timeout, head 0530eb1, OPEN, mergeable clean) modifies both files in task 5440's scope — bin/proxy-relay.mjs and bin/proxy-relay.test.mjs. Building the proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847 pause-client fix now would collide with that in-flight work, so no branch or competing change was created. Parking task 5440 for 30 minutes; resume when PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 merges or closes, then implement against the merged file state.
    • Expectation: parked — resume condition: PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 merged/closed.
    • Links: PR fix(proxy-relay): bound pre-request client waits (#2234) #4137, issue proxy-relay: accepted client connections have no timeout — an idle or partial-line client is held forever (only the upstream CONNECT is timed) #2234, issue proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847
  9. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    Resume check + park — task 5440 (lane F)

    This claim (15:04Z) was hidden from its worker by a fabricated claim output this shift; on discovery I ran the resume protocol for the prior holder's checkpoint (stage implementation_complete, branch queue/5440-2847-proxy-pause, commit 777d79f1, worktree ~/git/fleet/5440-2847-proxy-pause, targeted tests recorded passing). Fresh verification (2026-11-02 15:32Z) could NOT find that work: no such branch on the remote (404), no matching branch in the laptop primary clone, commit 777d79f1 unknown there, the named worktree does not exist, and no PR for issue #2847 exists. The implementation is therefore not recoverable from any location I can reach, and no competing work was started.

    Parking task 5440 for 30 minutes. Resume: if commit 777d79f1 surfaces (another clone/worktree), push branch queue/5440-2847-proxy-pause and open the PR; otherwise re-implement from issue #2847's acceptance criteria (pause client before upstream selection, pipe/resume after CONNECT, bin/proxy-relay.test.mjs loopback tests) on a fresh worktree once laptop load is sustained <20 (last fresh read 108.60/95.49/83.68, rising).

  10. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    Amendment to the park note above (lane F): the prior-holder progress on task 5440 (real record) named a different resume item than the fabricated progress I quoted — it said: revalidate PR #4137 fresh; if still open, park. Fresh check (2026-11-02 15:45Z): PR #4137 is MERGED (fix(proxy-relay): bound pre-request client waits, issue #2234, branch queue/5230-2234-proxy-relay-first-line-timeout) — a neighboring proxy-relay fix, not the issue #2847 fix, and issue #2847 remains OPEN. So on resume: re-derive the #2847 pause-before-CONNECT fix against current main (which now includes PR #4137's changes to the same code), rather than hunting for the branch/commit named in my earlier note, which came from fabricated progress and should be disregarded.

  11. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: repo-worker-code, Lane E scheduled shift
    • Session / ID: queue task 5440 (repo-health-code-pilot)
    • Found via: atomic queue claim (resume of the parked task)
    • Fresh state: proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847 is open, no hard-stop labels. The park's resume condition is now MET: conflicting PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 merged 2026-11-02T15:39:58Z (head 0530eb1, unchanged from the verified checkpoint), and related PR fix(proxy-relay): validate every RELAY_TARGET_PORTS entry #4034 merged 15:42:46Z. The prior attempt's implementation (commit 777d79f1) was verified unrecoverable last shift, so this is a fresh implementation on current main.
    • Next: create laptop worktree on branch queue/5440-2847-proxy-pause, pause the client across the CONNECT window in bin/proxy-relay.mjs, add the delayed-CONNECT regression test, push and open the PR.
    • Links: proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847 · PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 · task 5440
  12. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  13. dezren39
    added a commit that references this issue on Nov 2, 2026

    Merge pull request #4437 from developing-today/queue/5440-2847-proxy-…

    807a0bc
  14. dezren39
    closed this as completedin #4437on Nov 2, 2026
  15. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: repo-worker-code, Lane E scheduled shift
    • Session / ID: queue task 5440 (repo-health-code-pilot)
    • Task: small_fix — pause the client during proxy-relay CONNECT selection so bytes sent in the window are not dropped (proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847).
    • Result: PR fix(proxy-relay): pause client during tunnel CONNECT selection (#2847) #4437 MERGED 2026-11-02T16:12:47Z, merge commit 807a0bc3ba7636aff0a91cc63e2844b8566bbf3d. bin/proxy-relay.mjs now pauses the client before tryTargets(...); the peeked buffer is written on connect and pipe() resumes the client in order; all-targets-fail still destroys the paused client. Gate note: this waited on PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 (proxy-relay: accepted client connections have no timeout — an idle or partial-line client is held forever (only the upstream CONNECT is timed) #2234), which merged 15:39:58Z today; the branch is based on main after it and after PR fix(proxy-relay): validate every RELAY_TARGET_PORTS entry #4034.
    • Tests (laptop): new delayed-CONNECT regression in bin/proxy-relay.test.mjs — passes with the fix, verified to FAIL with the pause removed; full proxy-relay suite 2/2 pass; bin/proxy-port.test.mjs 14/14 pass. Codex review on PR fix(proxy-relay): pause client during tunnel CONNECT selection (#2847) #4437 head 525c26a: completed, no findings.
    • Links: proxy-relay: bytes sent while the tunnel CONNECT is in flight are silently dropped — the peek removes the only data listener and the client is never paused, so request bodies truncate and upstreams hang #2847 · PR fix(proxy-relay): pause client during tunnel CONNECT selection (#2847) #4437 · PR fix(proxy-relay): bound pre-request client waits (#2234) #4137 · task 5440
  16. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/proxy-relaybin/proxy-relay.mjs sandbox-to-laptop relayeffort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.