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: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires · Issue #2097 · developing-today/code

design-code-proxy: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires #2097

New issue
Copy link
New issue
Copy link
Closed
#4204
Closed
design-code-proxy: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires#2097
#4204
Copy link
Assignees
dezren39
Labels
app/design-code-proxybin/design-code-proxy.mjs fleet proxyeffort/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 29, 2026
Issue body actions

Summary

bin/design-code-proxy.mjs dispatch has no timeout on its backend requests: if a backend accepts the connection (or connects and then stalls) and never answers, the client request hangs forever and the proxy's own primary→fallback machinery never fires — fallback only triggers on a socket error, an HTTP 429/5xx response, or an in-body quota error, and a silent backend produces none of those. Each hung request also holds one socket from the shared keep-alive pool (maxSockets: 32 per scheme) indefinitely, so a wedged backend can gradually exhaust the pool for the healthy backend too.

Evidence (main bd880194, file sha256 27e9fc8c…)

  • bin/design-code-proxy.mjs — tryTarget (in dispatchWithFallback) builds the backend call with http.request({ hostname: '127.0.0.1', port: target.port, path: '/v1/chat/completions', agent: httpAgent, … }) and registers only localReq.on('error', …) → onFail. There is no localReq.setTimeout(...), no timeout option, and no abort anywhere in the dispatch path. The only AbortSignal.timeout in the file is 2500 ms on the background /v1/models catalog probes (:95).
  • The AMR upstream forward in the same file (clientReq = https.request(...), same handler) likewise sets no timeout; its error handler falls back to local dispatch, which a hanging upstream also never triggers.
  • The fallback contract is otherwise proven working: a primary that answers 500 falls back immediately (see probe control below).

Probe (laptop, 2026-10-28, shipped file unmodified)

Probe dir: ~/git/fleet/probe-2026-10-28-laneB-designtimeout/ (laptop) — two stub backends (primary switchable 500/hang, fallback healthy) + the shipped proxy on alternate ports (ANTIGRAVITY_LS_PROXY_PORT/CODEX_PROXY_PORT/DESIGN_CODE_PROXY_PORT env):

  • Control, healthy primary (gpt-6-luna → codex stub): 200 in 94 ms.
  • Control, primary answers 500 (design-code-pro → antigravity stub 500, codex stub healthy): 200 in 31 ms via fallback — the fallback machinery works when failure is signalled.
  • Test, primary accepts and never responds (design-code-pro, primary in hang mode): no response within 8000 ms (client-side AbortSignal timeout fired); the healthy fallback was never tried. The proxy itself stayed alive (GET /v1/models → 200 immediately after), so this is a per-request permanent wedge, not a crash.

Why it matters

dispatchWithFallback exists precisely so one bad backend doesn't take down design-code requests — the file already handles backend response errors, 429/5xx, and in-body quota errors (#681 fixed a sibling "hangs forever instead of falling back" bug in this same function). A backend that wedges silently (deadlocked language server, a proxy sibling stuck on its own upstream) is the remaining failure mode, and it is worse than a clean error: the client waits indefinitely and pooled sockets accumulate.

Acceptance criteria

  • A backend that connects but does not respond within a bounded time (triage pins the value; it should be generous enough for slow streaming first-byte, e.g. a time-to-first-response / socket-inactivity timeout rather than a total-stream deadline) causes onFail → fallback, and if both targets time out, a clean 502 — never an indefinite hang.
  • The AMR upstream forward (https.request path) gets the same treatment: a silent upstream falls back to local dispatch instead of hanging.
  • Streaming responses that are actively flowing are not killed by the timeout (inactivity-based, or reset on data).
  • Tests in bin/design-code-proxy.test.mjs style: hanging-primary → fallback serves; both-hang → 502 within a bounded time; slow-but-alive backend still succeeds.
  • Existing behaviours unchanged: 429/5xx fallback, in-body quota fallback, model rewriting on stream and non-stream paths.

Activity

Next
  1. developing-today commented on Oct 29, 2026

    @developing-today
    developing-todayBot
    on Oct 29, 2026 – with developing.today
    Contributor
    More actions

    CODE-1008

  2. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/normalOrdinary priority (the default)
    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
    app/design-code-proxybin/design-code-proxy.mjs fleet proxy
    effort/sSmall: expected under 2 hours of work
    on Oct 29, 2026
  3. dezren39 commented on Oct 29, 2026

    @dezren39
    dezren39
    on Oct 29, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-b
    • Session / ID: cron new-issue-creator-code-b run 2026-10-28 22:20 CDT
    • Found via: filed this run
    • Task: Triage design-code-proxy's missing backend timeout (bin/design-code-proxy.mjs tryTarget + AMR forward): pin an inactivity/first-response timeout value, wire it to onFail so the fallback fires, add hanging-backend tests.
    • Expectation: effort/s; done = a silent backend falls back (or 502 when both hang) within a bounded time, actively-streaming responses are not killed, existing 429/5xx/quota fallbacks unchanged.
    • Links: evidence probe ~/git/fleet/probe-2026-10-28-laneB-designtimeout/ (laptop, main bd88019, file sha256 27e9fc8c); sibling fixed case design-code-proxy: quota error in a 200 JSON body hangs the request forever — writeHead precedes the in-body check, so fallback can never fire #681 (same function, different hang cause)
  4. github-actions
    assigned
    dezren39
    on Oct 29, 2026
  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. 68 remaining items

  7. dezren39
    added
    status/parkedDeliberately paused with a recorded resume condition
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Nov 2, 2026
  8. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane F
    • Session / ID: task 5090
    • Found via: queue claim (resume — prior park rested on the dezren39 assignee; fresh labels on issue design-code-proxy: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires #2097 carry no hard stop: no held, user/owned, do-not-merge, or do-not-auto-edit, and labels govern per the runbook)
    • Task: implement the bounded backend timeout for design-code-proxy per task 5090 (local dispatch + AMR forward, fallback routing, three regression tests)
    • Expectation: effort/s; done = PR merged with node --test bin/design-code-proxy.test.mjs passing
    • Links: issue design-code-proxy: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires #2097
  9. dezren39
    added 3 commits that reference this issue on Nov 2, 2026

    fix(design-code-proxy): retire failed targets so late errors cannot t…

    9cdf285

    fix(design-code-proxy): retired target that wrote the client head sti…

    f76f23e

    Merge pull request #4204 from developing-today/queue/5090-2097-design…

    2b4172c
  10. dezren39
    closed this as completedin #4204on Nov 2, 2026
  11. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Nov 2, 2026
  12. dezren39 commented on Nov 2, 2026

    @dezren39
    dezren39
    on Nov 2, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane F
    • Session / ID: task 5090
    • Found via: queue claim
    • Task: PR fix(design-code-proxy): bound silent backends with inactivity timeout, preserve fallback (#2097) #4204 merged (merge commit 2b4172c) — design-code-proxy backend requests now carry a pinned 60s socket-inactivity timeout (env-overridable): silent local backends destroy into onFail → fallback / bounded 502; a silent AMR upstream falls back to local dispatch; actively streaming responses are untouched. Two Codex P2 rounds were fixed in-PR (retired-target isolation; mid-stream stall teardown) with regression tests; final Codex review of head f76f23e found no major issues, 0 unresolved threads. node --test bin/design-code-proxy.test.mjs: 16/16 pass on the laptop.
    • Expectation: done — issue design-code-proxy: backend dispatch has no timeout — a backend that accepts and never responds hangs the request forever and the fallback never fires #2097 closed by the merge
    • Links: PR fix(design-code-proxy): bound silent backends with inactivity timeout, preserve fallback (#2097) #4204 fix(design-code-proxy): bound silent backends with inactivity timeout, preserve fallback (#2097) #4204 · branch queue/5090-2097-design-code-proxy-timeout
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/design-code-proxybin/design-code-proxy.mjs fleet proxyeffort/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.