Skip to content

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

Open

Description

@dezren39

commandcode-proxy: COMMANDCODE_PROXY_TIMEOUT_MS is parsed with a bare Number() — a typo'd, negative, or >2³¹ value makes every request "time out" in ~1 ms instead of failing at startup

Evidence

bin/commandcode-proxy.mjs:60 (main e91098f1):

const TIMEOUT_MS = Number(process.env.COMMANDCODE_PROXY_TIMEOUT_MS || 240000);

No validation follows. TIMEOUT_MS drives every timeout in the proxy:

  • :567 — the ACP request() timer (ACP … timed out after ${timeoutMs}ms),
  • :675 / :682 — the ACP prompt timer, and the request timer derived as timeoutMs + 30000,
  • :945 — the spawn-fallback kill timer,
  • :1067 — the user-visible error text: `commandcode timed out after ${TIMEOUT_MS}ms`.

The sibling env values in the same bin/ family were hardened against exactly this failure class: ports go through the strict shared parser in bin/proxy-port.mjs (#483, #494 — "a bare parseInt is not a validator"), which fails at startup naming the variable and its value. The timeout never got the same treatment.

Probe (laptop, verbatim :60 expression + the same setTimeout use as :567/:675/:945)

Probe: ~/git/fleet/probe-2026-10-28-laneB-cctimeout/probe.mjs:

COMMANDCODE_PROXY_TIMEOUT_MS parsed TIMEOUT_MS timer fired after
abc NaN ~6 ms (TimeoutNaNWarning … set to 1)
240000junk NaN ~1 ms
-5000 -5000 ~2 ms (TimeoutNegativeWarning … set to 1)
9999999999999 9999999999999 ~2 ms (TimeoutOverflowWarning … does not fit into a 32-bit signed integer … set to 1)
300 (control) 300 ~306 ms

Why it matters

One typo in the service environment (a unit, a home-manager option, a hand edit) silently converts the proxy into a machine that fails every chat/agency request instantly, while reporting commandcode timed out after NaNms (or after -5000ms) — an error that points at the upstream engine, not at the configuration. The proxy starts cleanly and answers /health, so supervisors see a healthy process. A large-but-sane-looking value (e.g. 9999999999999, or anything above 2³¹−1 ≈ 24.8 days in ms) overflows Node's timer the same way. Startup is the right place for this to fail, as the port parser already established for this family.

Acceptance criteria

  • An invalid COMMANDCODE_PROXY_TIMEOUT_MS (non-numeric, trailing junk, zero, negative, or above a pinned maximum ≤ 2³¹−1) makes the proxy exit at startup with an error naming the variable and its value, in the style of proxy-port.mjs's parseProxyPort.
  • The parsing lives in a shared/strict helper (extending proxy-port.mjs or a sibling) rather than an inline copy unique to this proxy, or the triage comment pins why inline is right here.
  • Tests in bin/commandcode-proxy.test.mjs (or the helper's test file) cover: unset → 240000 default; a plain value → itself; each invalid class above → startup error.
  • No behaviour change for valid values: ACP request/prompt timers and the spawn kill timer receive the same millisecond values as today.

Related: #483 / #494 (strict port parsing for this same proxy family).

Activity

  1. developing-today commented on Oct 28, 2026

    @developing-today
    Contributor
  2. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued task in the Supabase agent queue
    effort/xsTrivial: expected under 30 minutes of work
    on Oct 28, 2026
  3. dezren39 commented on Oct 28, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

  4. dezren39 commented on Oct 30, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — design-architect pass 22 (2026-10-30): ADOPTED as Phase 1 of design #2835 (bin/ proxies, with #2823/#2786/#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.

  5. 62 remaining items

  6. removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Nov 4, 2026
  7. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

  8. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor
  9. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    event: picked-up
    task: 7726 (triage, repo-health-code-pilot; worker repo-worker-code; lane c8b9355e-319a-4640-8096-7ad19480d151)
    by: OpenChamber scheduled lane
    at: 2026-11-04T07:14:30Z

    Claimed and checkpointed task 7726. Fresh GitHub revalidation: #1809 is OPEN and assigned to Drew; PR #4026 (queue/5042-1809-strict-timeout) is OPEN, non-draft, and Drew-authored. This is active Drew-owned work. I will not inspect or modify PR #4026, touch its branch, or create competing work; parking the triage claim for 30 minutes, then rechecking ownership fresh.

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

    @dezren39
    MemberAuthor

    agent-note:v1
    event: parked
    task: 7726 (triage, repo-health-code-pilot; worker repo-worker-code; lane c8b9355e-319a-4640-8096-7ad19480d151)
    by: OpenChamber scheduled lane
    at: 2026-11-04T07:15:15Z
    resume-after: 2026-11-04T07:44:50Z

    Parked for 30 minutes. Fresh GitHub state: #1809 is OPEN and Drew-assigned; matching implementation PR #4026 (queue/5042-1809-strict-timeout) is OPEN and Drew-authored. This is active Drew-owned work, so no PR or branch was touched and no competing follow-up was created. Resume after the delay with fresh issue/PR/ownership checks; proceed only if the Drew-owned work is no longer active. Labels now reflect parked state (queue/parked, status/parked, work/assigned).

  12. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Agent note — task 7726 handed off to opencode execution lane

  13. added
    queue/queuedHas a queued task in the Supabase agent queue
    and removed
    work/assignedQueue worker lifecycle state
    on Nov 5, 2026
  14. dezren39 commented on Nov 5, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · handed off

    • Agent: fleet monitor
    • Session / ID: task 7726 (repo-fleet-monitor run 2026-11-05T15:45:48Z)
    • Found via: monitor reconciliation (Duty 1 claim/label divergence repair)
    • Task: Claim evaporated: task 7726 is queued and unclaimed in repo-health-code-pilot, but this issue still carried claimed labels. Labels reset to the truth (queue/queued + status/needs-triage). Checkpoint stage at evaporation: handed_off.
    • Expectation: The next lane claim picks task 7726 up from the queued state and posts a fresh pickup note.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/commandcode-proxybin/commandcode-proxy.mjs fleet proxyeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)queue/queuedHas a queued task in the Supabase agent queuesource/creatorFiled by the new-issue-creator jobsource/design-architectFiled by the repo design architect jobstatus/needs-triageNot yet triaged; needs a first lookstatus/parkedDeliberately paused with a recorded resume conditiontask/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