GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — opencode-usage-export: --window-hours / --fresh-hours are never validated — a junk window publishes a zero-filled status:ok document, a junk freshness reports a fresh store as moved · Issue #4739 · developing-today/code Closed Labels app/opencode-usage-exportPackage/app: opencode-usage-export (pm-stack in this repo)app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobstatus/in-progressQueue worker lifecycle statetask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests Descriptionopencode-usage-export: --window-hours / --fresh-hours are never validated — a junk window publishes a zero-filled
|
| Invocation | Result |
|---|---|
| control (defaults) | exit 0, status: "ok", 1 session |
--window-hours banana |
exit 0, status: "ok", 0 sessions, windowHours: NaN |
--window-hours (value missing) |
exit 0, status: "ok", 0 sessions, windowHours: NaN |
--window-hours -5 |
exit 0, status: "ok", 0 sessions |
--window-hours Infinity |
exit 0, status: "ok", 2 sessions — the 48 h-old session outside any real window is included |
--fresh-hours banana |
exit 4, store-stale: "no candidate store has session_v2 activity within NaNh; newest activity [1 minute ago] — the live store may have moved" |
--fresh-hours -1 |
exit 4, store-stale, same misleading moved-store diagnosis for a store updated 1 minute ago |
The module's own contract is fail-closed: the header (:29-31) promises a tick that cannot read the live store "writes a failure document and exits non-zero — never a zero-filled success", and the README repeats that a failed tick can never look like a reading. An invalid --window-hours breaks exactly that promise: latest.json becomes a status: "ok" document with zero sessions and zero totals, indistinguishable downstream (slices 2–7 of #2072 consume this document) from "OpenCode was genuinely idle for 24 h". An invalid --fresh-hours fails closed but with the wrong diagnosis — it tells the operator the store moved when the store is fine and the flag is wrong, sending them hunting for a moved database. The systemd unit passes neither flag today, so this bites manual ticks, debugging runs, and any future unit/timer change that starts passing them.
Distinct from #1566 (meta-exporter window_duration_secs, a different tool, closed) and #4381 (cloudflare-export threshold accepting 0): no open or closed issue covers this exporter's argument validation (searched usage-export in:title, --window-hours, exporter/NaN, 2026-11-02).
--window-hours and --fresh-hours values that are missing, non-numeric, NaN, infinite, zero, or negative are rejected before any store read: a failure document with a status/detail that names the invalid argument (not store-stale), and a non-zero exit.opencode-usage-export.test.mjs cover at least: junk window, missing window value, negative window, junk freshness — each asserting no status: "ok" document is produced and the failure detail names the bad argument.ok document can ever carry a non-finite or non-positive windowHours.🤖 Agent note · filed
Picked up as task 8444 by lane code-c (repo-queue worker) and handed off to the opencode execution lane per the execution-lane assignment for task 8444. The laptop claimant launches the bound opencode session for task 8444; this lane does not work issue #4739 directly. Note: task 8444 is at attempts 19/32.
🤖 Agent note · handed off
🤖 Agent note · handed off
🤖 Agent note · handed off
🤖 Agent note · correction
gh pr list --search 4739 in the same check returned open PR fix(usage-export): validate hours flags (#4739) #4790 "fix(usage-export): validate hours flags (opencode-usage-export: --window-hours / --fresh-hours are never validated — a junk window publishes a zero-filled status:ok document, a junk freshness reports a fresh store as moved #4739)", which appears to own this fix. The bound opencode session should evaluate/advance PR fix(usage-export): validate hours flags (#4739) #4790, not open a competing PR. The handoff itself stands.agent-note:v1
state: handed off
task: 8444 (repo-health-code-pilot, worker repo-worker-code)
session: ses_e5e5589f378ffejE3h9MHlWsSx
found via: queue claim; execution lane opencode
launch: session created on the laptop OpenCode server at verified primary location /home/user/git/code, bound atomically before the prompt was sent.
next: the bound session revalidates issue #4739 and current main, works only this task, heartbeats, and records the terminal outcome with the same session ID.
links: task 8444 · issue #4739
Picked up by repo-worker-code-f — working this now. (Fleet queue fallback mode: the queue backend is down, so this issue's comments carry the claim. The claim stays live while repo-worker-code-f posts progress markers; after 30 minutes of silence any other worker may pick this up.)
Progress from repo-worker-code-f: implementation_complete: parseHourFlag validation + run() fail-closed routing; 9/9 tests pass on laptop (node --test file form); next: commit + PR
🤖 Agent note · fixed — PR #6810 open, remainder: merge on green CI
queue/4739-usage-export-arg-validation, commit 761c60f744. --window-hours/--fresh-hours now go through parseHourFlag (missing / non-numeric / NaN / infinite / zero / negative → ExportError("invalid-argument", exit 2) naming the flag, before any store read); run() routes argument errors to a failure document routed to --out-dir when parsed, instead of an uncaught throw. Valid values behave exactly as before.opencode-usage-export.test.mjs (junk window, missing window value, negative window, junk freshness, valid-value control). Laptop run (node v24, file form): 9/9 pass (4 pre-existing + 5 new). The directory form of node --test fails identically on clean main — pre-existing, untouched.free, not done): PR fix(opencode-usage-export): validate --window-hours/--fresh-hours (#4739) #6810's CI had not completed within the poll window (fleet CI is heavily backlogged tonight; PR docs(aggregator): success-only memoization contract + highlight latch fix (#3880) #6796's checks are likewise still queued). Next worker: check PR fix(opencode-usage-export): validate --window-hours/--fresh-hours (#4739) #6810 (incl. Codex findings — disposition any before merging); if green, merge and close opencode-usage-export: --window-hours / --fresh-hours are never validated — a junk window publishes a zero-filled status:ok document, a junk freshness reports a fresh store as moved #4739. The branch and tests are final; do not redo the fix.Merge pull request #6810 from developing-today/queue/4739-usage-expor…