Repository navigation
docs: record enabled OpenCode quota summary timer - #12267
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 30 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 546e925913
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| set -Eeuo pipefail | ||
| umask 077 | ||
|
|
||
| SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" |
There was a problem hiding this comment.
Reject undeclared arguments before starting the job
When an operator invokes this entry point with --dry-run, a typo, or a stray positional argument, the script ignores it and executes the full job, overwriting logs and invoking the configured OpenCode route. A temporary-fixture invocation of run.sh --dry-run confirmed that it exits successfully and invokes the fake OpenCode executable. Declare the no-argument contract and reject unexpected arguments before any subprocess or filesystem operation; AGENTS.md explicitly requires strict parsing before side effects.
AGENTS.md reference: AGENTS.md:L44-L47
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Already addressed in 1b26b76 (the current head), which Codex reviewed with no findings: run.sh rejects any argument before touching the filesystem, the summary picks the newer of the embedded and standalone heartbeats, and lapsed is kept, counted and named in the prompt. test.sh passes.
Generated by Claude Code
| "gathererHealthy": heartbeat.get("ok") is True and not heartbeat.get("error"), | ||
| "gathererError": bool(heartbeat.get("error")), |
There was a problem hiding this comment.
Read the latest standalone heartbeat before reporting health
When a gatherer tick fails before collecting providers, failTick() in pm-stack/aggregator/scripts/gather-quota.ts writes an unhealthy standalone quota-gatherer-heartbeat.json but deliberately leaves quota-current.json unchanged. Reading only the embedded heartbeat therefore reports gathererHealthy: true and gathererError: false from the previous successful tick, even while the current gatherer is failing; the snapshot can also remain fresh within the 30-minute threshold. Read and validate the standalone heartbeat and select the newer record, as the existing latestQuotaHeartbeat() consumer does, before calculating these health fields.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Already addressed in 1b26b76 (the current head), which Codex reviewed with no findings: run.sh rejects any argument before touching the filesystem, the summary picks the newer of the embedded and standalone heartbeats, and lapsed is kept, counted and named in the prompt. test.sh passes.
Generated by Claude Code
| "state": provider.get("state") | ||
| if provider.get("state") in ("ok", "error", "unconfigured") | ||
| else "unknown", |
There was a problem hiding this comment.
Preserve the supported lapsed provider state
When an OpenCode Go or Meta session expires, entryFromResult() in pm-stack/aggregator/src/quota-gather-map.ts deliberately emits state: "lapsed" rather than "error". This whitelist converts that valid failure state to "unknown", losing the information needed to identify the expired session. A newly measured lapsed row can be fresh and non-retained, so it also falls outside every problem category the prompt explicitly asks the model to name. Preserve lapsed in the report, count it separately, and include it among the prompt's reportable states.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Already addressed in 1b26b76 (the current head), which Codex reviewed with no findings: run.sh rejects any argument before touching the filesystem, the summary picks the newer of the embedded and standalone heartbeats, and lapsed is kept, counted and named in the prompt. test.sh passes.
Generated by Claude Code
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Summary
Track the OpenCode scheduled-job pilot in the repository: a per-job systemd service/timer, explicit route, fixed logs/history, a fail-closed input sanitizer, and a strict installer. The timer state is unchanged by default;
--enableis the explicit opt-in.The quota-freshness summary is the single read-only pilot. The fleet registry records the same schedule.
Evidence
~/atlasdirectory; the PR contained registry documentation but not the reproducible package.bash pm-stack/opencode-scheduled-jobs/test.sh— PASS (fake OpenCode invocation, explicit route, fixed log/history, sensitive-field omission, strict CLI rejection).bash -nandgit diff --check— PASS; rendered service/timer passsystemd-analyze --user verify(one unrelated existingpm-host-health.timerwarning).opencode-quota-freshness-summary.timerfired at 2026-11-21 20:00:58 CST and completed at 20:01:17 CST with systemdResult=success, exit 0.history.jsonlrecords run20261122T020058Z, routeopencode-route/workhorse;latest.logcontains the summary.Merge Danger
Door: Two-way; disable the timer and restore the registry row to reverse the pilot.
Blast Radius: Narrow — one read-only hourly laptop job and its own logs.
Refs #2232.