GeezerVison is showing github.com — 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 · Issue #1809 · developing-today/code
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 #1809Descriptioncommandcode-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). Activitydeveloping-today commented on Oct 28, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item effort/xsTrivial: expected under 30 minutes of work on Oct 28, 2026dezren39 commented on Oct 28, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b run 2026-10-28 15:20 CDT
- Found via: filed this run
- Task: Filed after verifying on main
e91098f1 that bin/commandcode-proxy.mjs:60 parses COMMANDCODE_PROXY_TIMEOUT_MS with a bare Number() and no validation, while every timeout in the proxy (ACP request :567, prompt :675, spawn kill :945, error text :1067) consumes it. Laptop probe of the verbatim expression + same setTimeout use: 'abc'/'240000junk' → NaN, timer fires ~1-6ms; '-5000' → fires ~2ms; '9999999999999' → TimeoutOverflow, fires ~2ms; control '300' → 306ms. The bin/ family's ports were hardened against this exact class in bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483/antigravity-ls-proxy: ANTIGRAVITY_LS_ADDRESS port parsed with bare parseInt — malformed addresses silently discarded, managed daemon spawned instead #494 (proxy-port.mjs strict parser, startup failure naming the variable); the timeout was not.
- Expectation: effort/xs — triage pins the valid range/max (≤2^31−1) and whether the strict parser extends proxy-port.mjs or a sibling helper; startup failure naming variable+value; tests for unset/plain/each invalid class.
- Links: packet
queue-packets/packet-1809.json (repo-health-code-pilot, triage); probe ~/git/fleet/probe-2026-10-28-laneB-cctimeout/ (laptop); related bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483, antigravity-ls-proxy: ANTIGRAVITY_LS_ADDRESS port parsed with bare parseInt — malformed addresses silently discarded, managed daemon spawned instead #494
dezren39 commented on Oct 30, 2026 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. dezren39 commented on Nov 5, 2026 🤖 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.
dezren39 commented on Nov 8, 2026 developing-today commented on Nov 8, 2026 🤖 Agent note · closed as superseded — target file decommissioned on main
- Agent: queue worker (repo-worker-code), lane code-h
- Session / ID: task 13373 (pr_shepherd, batch issue Unowned PR batch from branch disposition (2026-11-07) #7297 part 3)
- Found via: queue claim
- Fresh revalidation (2026-11-08T16:20Z): PR fix(commandcode-proxy): validate timeout at startup (#1809) #4026 OPEN, no hard-stop labels, Codex review clean on head 36acc19 (has_any_findings=false), diff itself sound (switch COMMANDCODE_PROXY_TIMEOUT_MS to the shared strict parseProxyMillis). But the PR is CONFLICTING/DIRTY against current main.
- Why it cannot and should not land: rebasing onto current origin/main in laptop worktree /home/user/git/fleet/13373-4026 produced modify/delete conflicts: bin/commandcode-proxy.mjs and bin/commandcode-proxy.test.mjs were DELETED on main by commit 1ad7042 chore(proxy): decommission the retired CLI proxy lineage (Drew, 2026-11-06), which also removed bin/commandcode-proxy-start.sh. Verified independently via the GitHub API: that commit lists all three files as removed, and GET contents/bin/commandcode-proxy.mjs?ref=main returns 404. COMMANDCODE_PROXY_TIMEOUT_MS exists nowhere on current main; the successor bin/opencode-route-proxy.mjs already parses its timeout with the same strict parseProxyMillis.
- Disposition: PR fix(commandcode-proxy): validate timeout at startup (#1809) #4026 closed as superseded (branch left untouched, not deleted by hand); issue 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 closed with this evidence — the buggy code path no longer exists, so the defect cannot occur. Rebase aborted, PR head unchanged at 36acc19.
- Links: issue 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, issue Unowned PR batch from branch disposition (2026-11-07) #7297, commit 1ad7042, task 13373
dezren39 commented on Nov 9, 2026 🤖 Agent note · done (already_done)
- Agent: repo queue worker, lane code-t (repo-worker-code)
- Session / ID: cron repo-queue-worker-shift-t run 2026-11-09; task 14327
- Found via: claimed task 14327 this shift (small_fix follow-on for issue 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, revived from task 5042); execution-lane assignment returned opencode (lane row 5560), but fresh revalidation shows the work is already resolved, so the task completes here instead of handing off.
- Evidence: issue 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 is CLOSED (stateReason COMPLETED) at 2026-11-08T16:20:46Z by task 13373 (lane code-h): the target file bin/commandcode-proxy.mjs was decommissioned on main by commit 1ad7042, the buggy COMMANDCODE_PROXY_TIMEOUT_MS parse exists nowhere on current main, the successor proxy already uses the strict parse, and fix PR fix(commandcode-proxy): validate timeout at startup (#1809) #4026 was closed as superseded. The defect cannot occur.
- Outcome: task 14327 completed as already_done; no code changed, no PR opened.
- Links: task 14327 · issue 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 · PR fix(commandcode-proxy): validate timeout at startup (#1809) #4026 · commit 1ad7042
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|