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 — design-code-proxy: the streaming half of PR #685's Content-Length fix has no regression test — the stub never sets Content-Length on SSE responses · Issue #688 · developing-today/code

design-code-proxy: the streaming half of PR #685's Content-Length fix has no regression test — the stub never sets Content-Length on SSE responses #688

New issue
Copy link
New issue
Copy link
Closed
#1074
Closed
design-code-proxy: the streaming half of PR #685's Content-Length fix has no regression test — the stub never sets Content-Length on SSE responses#688
#1074
Copy link
Assignees
dezren39
Labels
effort/sSmall: expected under 2 hours of workkind/testTest coverage, test infrastructure, or test-only fixesmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Finding

PR #685 fixed design-code-proxy forwarding the backend's Content-Length for bodies it re-serializes or rewrites — but only the non-stream half of that fix has a regression test. The streaming half is untested: no test in the suite can fail if the streaming path starts forwarding the stale length again.

Evidence

  • PR: fix(design-code-proxy): don't forward the backend's Content-Length for re-serialized bodies (#684) #685 (merged, merge commit 0a405c64a908d14c68280959f49342a22ce11d0c, fixes design-code-proxy: forwarded Content-Length truncates the re-serialized success body (PR #682) #684)
  • The fix has two halves in bin/design-code-proxy.mjs on current main 4f905d75:
    • Non-stream: writeHead(sentBody) advertises the re-serialized body's real length (bin/design-code-proxy.mjs:239-240, call sites :287 and :290).
    • Streaming: writeHead() is called with no body at :249, which deletes the backend's content-length at :241-243 so Node chunks the model-rewritten SSE stream.
  • The new regression test (bin/design-code-proxy.test.mjs, "backend Content-Length does not truncate the re-serialized success body (design-code-proxy: forwarded Content-Length truncates the re-serialized success body (PR #682) #684)") only posts a non-stream request. Its stub mode ok-length is explicitly gated to non-stream requests: stub.mode === 'ok-length' && !bodyText.includes('"stream":true') (bin/design-code-proxy.test.mjs:51).
  • The only streaming test, "streaming success is unchanged" (bin/design-code-proxy.test.mjs:196-204), uses the stub's streaming branch at :58-66, which answers res.writeHead(200, { 'Content-Type': 'text/event-stream' }) — it never sets a Content-Length, so the pre-fix and post-fix proxies behave identically for it.
  • PR fix(design-code-proxy): don't forward the backend's Content-Length for re-serialized bodies (#684) #685's own ablation confirms the gap: with only bin/design-code-proxy.mjs reverted, "exactly the new test fails; the other 5 design tests still pass" — i.e. reverting the streaming half of writeHead fails nothing.

Verified this run (pr-diff-review): design suite passes 6/6 on current main, and the diff/stub/test lines above were cross-checked via gh pr diff 685, gh api pulls/685/files, and the local clone at origin/main.

Why it matters

The streaming path rewrites every SSE chunk's model field (bin/design-code-proxy.mjs:255-267), so a forwarded backend Content-Length is wrong for streamed responses in exactly the same way #684 documented for buffered ones: the client would stop reading at the backend's byte count, truncating the stream (and corrupting keep-alive framing for whatever follows). Today the code is correct; what is missing is the pin that keeps it correct. The sibling non-stream case shows this bug class has already shipped once in this file.

Single-repo: design-code-proxy exists only in this repo (per PR #685's git-grep check across the other three repos, re-confirmed by this job's sibling-proxy grep — no other proxy in bin/ spreads backend response headers).

Acceptance criteria

  • The stub backend gains a streaming mode that sets an explicit Content-Length on its SSE response (computed over the chunks it sends, whose model the proxy will rewrite to a different-length value).
  • A regression test posts { stream: true } against that stub and asserts the client receives the complete stream (all chunks plus data: [DONE]) and that any advertised Content-Length equals the byte count actually received.
  • Ablation: with the streaming delete headers['content-length'] behaviour reverted (stale length forwarded), the new test fails; with the fix in place, the full design-code-proxy suite passes.

Activity

Next
  1. github-actions
    assigned
    dezren39
    on Oct 23, 2026
  2. dezren39
    added
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/pr-diff-reviewFiled by the pr-diff-review job
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 25, 2026
  3. dezren39 commented on Oct 26, 2026

    @dezren39
    dezren39
    on Oct 26, 2026
    MemberAuthor
    More actions

    Intake review

    Still live (verified this run, fleet monitor): bin/design-code-proxy.test.mjs on current main still gates the ok-length stub mode to non-stream requests (line 51: stub.mode === 'ok-length' && !bodyText.includes('"stream":true')), and the streaming branch (lines 58–59) still answers with only Content-Type: text/event-stream — no Content-Length — so the streaming half of PR #685's fix still has no test that can fail. The fix itself is present (delete headers['content-length'] on the streaming path).

    Related: PR #685 / closed #684 (the fix), #692 and #694 (sibling untested-half findings from the same review round). This issue is queued for triage as pilot task 1067 (queue/queued unchanged by this enrichment).

    Notes / risks: test-only change; the risk is a stub that sets a length the rewritten stream coincidentally matches — set the stub's declared length to the backend body's byte count (pre-rewrite), which the model-rewritten stream must differ from.

    Suggested approach: extend the stub with a streaming mode that sets Content-Length on the SSE response, and assert the proxied response is chunked/untruncated and the full rewritten stream arrives.

    Labels normalized by the fleet monitor: kind/test, priority/normal, effort/s.

  4. dezren39
    added
    kind/testTest coverage, test infrastructure, or test-only fixes
    priority/normalOrdinary priority (the default)
    effort/sSmall: expected under 2 hours of work
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 26, 2026
  5. 5 remaining items

  6. dezren39
    added
    queue/queuedHas a queued queue task
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/queuedHas a queued queue task
    on Oct 27, 2026
  7. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    Picked up by queue worker (Lane A) — implementing task 1228: streaming stub gains a stale Content-Length mode + regression test, ablation-verified.

    {"v":1,"kind":"note","state":"in-progress","task_id":1228,"summary":"Claimed fix task 1228 (follow-up to my triage 1067). Plan: add a stub mode that serves the SSE stream with a short/stale Content-Length, add a test asserting the client receives the full rewritten stream incl. [DONE], verify the test FAILS under the streaming-delete ablation and passes on current code.","artifacts":[],"next":"implement in worktree wt-1228, run suite + ablation, push, PR"}
    
  8. developing-today
    added
    status:in-review
    on Oct 27, 2026
  9. dezren39
    closed this as completedin #1074on Oct 27, 2026
  10. dezren39
    added a commit that references this issue on Oct 27, 2026

    Merge pull request #1074 from developing-today/queue/1228-688-streami…

    e793b32
  11. developing-today
    added
    status:done
    and removed
    status:in-review
    on Oct 27, 2026
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 27, 2026
  13. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    Done — PR #1074 merged (merge commit e793b32); issue auto-closed. The streaming stub now serves SSE with a stale Content-Length (ok-length-stream mode) and the new regression test passes on current code (suite 7/7) and fails under the streaming-delete ablation (exactly that test, 6 pass / 1 fail).

    {"v":1,"kind":"note","state":"done","task_id":1228,"summary":"PR 1074 merged: streaming Content-Length regression test added for design-code-proxy. Ablation-verified both directions locally; CI green.","artifacts":["https://github.com/developing-today/code/pull/1074"],"next":"none — task 1228 complete (fixed_merged)"}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

effort/sSmall: expected under 2 hours of workkind/testTest coverage, test infrastructure, or test-only fixesmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/normalOrdinary priority (the default)source/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/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.