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 — opencode-route-proxy: OPENCODE_ROUTE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value starts healthy, then every routed request 'times out' in ~1ms and blames the leaf · Issue #2786 · developing-today/code

opencode-route-proxy: OPENCODE_ROUTE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value starts healthy, then every routed request 'times out' in ~1ms and blames the leaf #2786

New issue
Copy link
New issue
Copy link
Closed
#3024
Closed
opencode-route-proxy: OPENCODE_ROUTE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value starts healthy, then every routed request 'times out' in ~1ms and blames the leaf#2786
#3024
Copy link
Assignees
dezren39
Labels
app/opencode-route-proxybin/opencode-route-proxy.mjs fleet proxyeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobtask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Problem

bin/opencode-route-proxy.mjs parses its per-request deadline with a bare Number():

  • bin/opencode-route-proxy.mjs:51 — const TIMEOUT_MS = Number(process.env.OPENCODE_ROUTE_PROXY_TIMEOUT_MS || 1_200_000);
  • bin/opencode-route-proxy.mjs:535-538 — the value goes straight into setTimeout(() => deadlineCtl.abort(...), TIMEOUT_MS), the deadline that bounds every routed chat-completion request.

The proxy starts up happily with a bad value — nothing validates it — and then the deadline fires almost immediately on every request. The client gets a 502 that looks like a leaf/transport failure, the leaf is never contacted, and the route-attempt ledger records the attempt as a timeout — so the failure is misattributed to the backend pool, not to local configuration.

This is the one fleet proxy whose timeout env var did not get the strict treatment its siblings got: the listen ports all go through parseProxyPort in bin/proxy-port.mjs (#483, which exists precisely because "a bare parseInt is not a validator"), commandcode-proxy's identical timeout bug is filed as #1809, and agy-proxy's is inside #2096. The route proxy's was missed.

Evidence (verified this run, main 24ddc153)

Probe on the laptop (~/git/fleet/probe-2026-10-30-laneA-routetimeout/): the real opencode-route-proxy.mjs + proxy-port.mjs copied verbatim (md5 19286417… / 9b6fc7c1…, matching main), spawned against a fake leaf that delays 300 ms before answering, with the fixture config/ledger shape from bin/opencode-route-proxy.test.mjs:

OPENCODE_ROUTE_PROXY_TIMEOUT_MS Proxy starts POST /v1/chat/completions Leaf hits Ledger
15000 (control) yes 200 in 342 ms, leaf content returned 1 outcome success
abc yes 502 in 23 ms — leaf transport error: opencode-route-proxy deadline 0 outcome timeout, tag Transport
3000000000 (> 2³¹−1) yes 502 in 23 ms, same error (plus Node TimeoutOverflowWarning: the value is clamped to 1 ms) 0 outcome timeout, tag Transport
-5 yes 502 in 24 ms, same error 0 outcome timeout, tag Transport

Mechanism: Number("abc") is NaN, and setTimeout(NaN) / setTimeout(-5) fire in ~0–1 ms; a value above 2³¹−1 is clamped by Node to 1 ms. Non-decimal spellings are silently reinterpreted instead of rejected (Number("0x493e0") = 300000, Number("1e6") = 1000000).

Why it matters

  • A single typo in the one env var that tunes this proxy takes the whole routing door down while it reports itself healthy (/health is local and still answers 200) and blames the leaves in the ledger — the worst shape of config failure for a fleet that debugs from the ledger.
  • The route proxy is the routing-only door (opencode-route door must be routing-only: no OpenCode session/loop per model request #2518); its deadline is the only bound on a hung leaf attempt chain, so the value being silently wrong removes or falsifies that bound.

Acceptance criteria

  • OPENCODE_ROUTE_PROXY_TIMEOUT_MS is strictly validated at startup (decimal integer milliseconds within a stated sane range — e.g. via a proxy-port.mjs-style helper shared with the fix for commandcode-proxy: COMMANDCODE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value makes every request 'time out' in ~1ms instead of failing at startup #1809 if that lands first): an invalid value exits at startup with an error naming the variable and its value, like parseProxyPort does for ports.
  • Valid values behave exactly as today (default 1,200,000 ms when unset/empty).
  • Tests in bin/opencode-route-proxy.test.mjs (or the shared helper's tests) cover at least: abc, a negative value, and a value above 2³¹−1 — each refused at startup — plus a valid small value still enforcing a real deadline against a slow leaf.
  • No behaviour change for any other env var or route.

Filed by new-issue-creator-code-a, 2026-10-30. Dedup: #1809 is commandcode-proxy's COMMANDCODE_PROXY_TIMEOUT_MS only; #2096 covers agy-proxy's vars; #2758 is pm-dispatch's port/host config. No existing issue mentions OPENCODE_ROUTE_PROXY_TIMEOUT_MS.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    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/opencode-route-proxybin/opencode-route-proxy.mjs fleet proxy
    effort/xsTrivial: expected under 30 minutes 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 (new-issue-creator-code-a)
    • Session / ID: cron new-issue-creator-code-a, run 2026-10-30 11:05 CDT
    • Found via: filed this run
    • Task: Filed after verifying the real proxy on the laptop against a 300 ms-delayed leaf: control timeout succeeds; abc / -5 / 3000000000 all start healthy, then 502 every request in ~23 ms with the leaf never contacted and a timeout ledger row blaming the leaf.
    • Expectation: effort/xs — strict startup validation of the one env var (proxy-port.mjs-style), plus refusal tests.
    • Links: evidence body + probe in goal hidden_files (issue-code-routetimeout-body.md); laptop probe ~/git/fleet/probe-2026-10-30-laneA-routetimeout/
  3. github-actions
    assigned
    dezren39
    on Oct 30, 2026
  4. dezren39
    added a parent issue on Oct 30, 2026
    • Design: env numbers are arguments — one strict parse for boot-time configuration #2835
  5. dezren39
    added
    source/design-architectFiled by the repo design architect job
    on Oct 30, 2026
  6. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    agent-note:v1 — design-architect pass 22 (2026-10-30): ADOPTED as Phase 1 of design #2835 (bin/ proxies, with #2823/#1809/#2096): this issue's timeout parses through the NEW shared millis helper Phase 1 adds to bin/proxy-port.mjs (digits-only, 1-2^31-1, boot failure naming the variable) — not a private guard. Linked as a sub-issue of #2835 (verified in its sub_issues list). Triage: do NOT re-file/re-scope/split this issue; record the phase structure and land it as the phase, with the decisions recorded on #2835 and in its design doc (files/designs/code-env-config-strict-parse.md). This issue keeps its own queued triage packet.

  7. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Oct 30, 2026
  8. 3 remaining items

  9. dezren39 commented on Oct 30, 2026

    @dezren39
    dezren39
    on Oct 30, 2026
    MemberAuthor
    More actions

    agent-note:v1 — triaged, follow-up enqueued

    • task: 3964 triage (lane D shift, 2026-10-30)
    • verdict: CONFIRMED on current main (fresh gh api read 2026-10-30T22:55Z): bin/opencode-route-proxy.mjs:51 still parses OPENCODE_ROUTE_PROXY_TIMEOUT_MS with a bare Number(), feeding setTimeout(deadlineCtl.abort, TIMEOUT_MS). No PR or branch owns this work; no hard-stop labels.
    • phase structure recorded per design-architect pass 22: this is Phase 1 of design Design: env numbers are arguments — one strict parse for boot-time configuration #2835 — the fix adds the NEW shared millis helper to bin/proxy-port.mjs (digits-only, 1..2^31-1, boot failure naming the variable) and routes this timeout through it; siblings commandcode-proxy: COMMANDCODE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value makes every request 'time out' in ~1ms instead of failing at startup #1809/agy-proxy: four numeric env vars parsed with bare Number() — 'abc' disables the worker cap and idle eviction and freezes the model catalog, a typo'd turn timeout fires in ~1ms, and MAX_LIVE_WORKERS=0 crashes the eviction loop #2096/antigravity-direct: ANTIGRAVITY_DIRECT_PORT / _TIMEOUT_MS are bare Number() — bypasses the house strict port helper, so bad ports crash with a stack or bind the wrong port, and bad timeouts start healthy then 502 every request #2823 reuse the helper in their own phases and are NOT fixed here. Issue not re-filed/re-scoped/split.
    • follow-up: small_fix task 4027 enqueued (dedupe repo-health:v1:fix:developing-today/code:issue:2786) with the issue's acceptance criteria intact, including the abc / negative / >2^31-1 refusal tests and the slow-leaf deadline test.
    • labels: queue/queued mirrors the queued follow-up task 4027.
  10. 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
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    queue/queuedHas a queued queue task
    on Oct 30, 2026
  11. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1 — picked up

    • task: 4027 small_fix (worker: repo-worker-code, origin: openchamber-scheduled-lane)
    • state: claimed
    • action: implementing Phase 1 of design Design: env numbers are arguments — one strict parse for boot-time configuration #2835 for opencode-route-proxy: OPENCODE_ROUTE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2^31 value starts healthy, then every routed request 'times out' in ~1ms and blames the leaf #2786 — adding shared strict millis helper to bin/proxy-port.mjs and parsing OPENCODE_ROUTE_PROXY_TIMEOUT_MS in bin/opencode-route-proxy.mjs with refusal tests.
  12. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 31, 2026
  13. dezren39 commented on Oct 31, 2026

    @dezren39
    dezren39
    on Oct 31, 2026
    MemberAuthor
    More actions

    agent-note:v1 — done (PR opened)

    • task: 4027, repo-worker-code, openchamber-scheduled-lane
    • PR: fix: validate route proxy timeout at startup #3024; issue remains open pending merge.
    • Targeted tests: proxy-port 10 passed; opencode-route-proxy 9 passed. CI pending. Broad bin run timed out with agy/codex failures involving installed clients; clean-main baseline not verified.
    • Sandbox bookkeeping deferred to fleet reconciliation.
  14. dezren39
    closed this as completedin #3024on Nov 1, 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/opencode-route-proxybin/opencode-route-proxy.mjs fleet proxyeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect 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.