Repository navigation
feat: implement issue #2160 — GitHub drops about 60% of scheduled ticks here: give the budget poller a second cron slot and a staleness window that matches - #2163
Conversation
…ks here: give the budget poller a second cron slot and a staleness window that matches
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Code Review
This pull request updates the dry-run budget poller to run on two hourly cron slots instead of one to address dropped scheduled ticks, adjusts the staleness warning threshold from 3 to 6 hours, and adds tracking for trigger events, cron schedules, and start delays. Feedback suggests using a structural YAML parser like yq instead of raw text scanners (grep and awk) in the tests to ensure robust assertions on the workflow configuration.
CodeAnt Nitpicks1 code suggestion1. With an even number of delay samples, this selects the upper middle value instead of averaging the two middle values, so the reported median is wrong.Logic error · |
CodeAnt PR Risk: Low Risk
Assessed commit: |
There was a problem hiding this comment.
All reported issues were addressed across 7 files
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
Advisory bots were rate-limited; auto-approval is withheld until they recover. pr-review-sweep will re-review this PR after 2026-10-09T23:39:35Z. |
…ML with yq Test-Change-Justification: tests added earlier in this same PR (#2163) rewritten to use yq per reviewer request; no pre-existing test altered. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dev-Lead — review-changes (applied)Changes committed and pushed. Requested items addressed:
|
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
You’re at about 97% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Dev-Lead — waiting on PR blockers (intent: fix-reviews)PR: #2163 |
|
No description provided. |
|
No description provided. |
|
Fixed in scripts/lib/budget-poller.sh line 368: added explicit |
Existing test changed without justification — human attention neededThe If the test really is wrong, a human should make that call, or the fix should carry a |
|
No description provided. |
This comment has been minimized.
This comment has been minimized.
|
No description provided. |
|
No description provided. |
Test-Change-Justification: poller default bp_stale_hours raised 3h->6h in this PR; maintainer review on #2163 (thread PRRT_kwDOR9SdIs6q_gFL) required the update. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Dev-Lead — fix-reviews (not-applied)A commit was pushed, but it did not touch any region the review named — the requested changes were not applied. Per requested item:
|
|
No description provided. |
|
No description provided. |
This comment has been minimized.
This comment has been minimized.
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
|
No description provided. |
…iddle values for even-length arrays With an even number of delay samples, explicitly floor the division result before using it as an array index to ensure both middle values are correctly selected and averaged, rather than selecting only the upper middle value. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
|
Fixed in scripts/lib/budget-poller.sh: explicitly floor the division result before using it as an array index in the even-length case to ensure both middle values are correctly selected and averaged, rather than selecting only the upper middle value. |
|
|
No description provided. |
Dev-Lead — fix-reviews (no-changes)Agent reasoning |
|
No description provided. |
|
CodeRabbit rate-limit notice: the free OSS review quota was exhausted and no code review was performed. There are no actionable findings to address in this comment — all CI checks pass. |
Dev-Lead — fix-bot-comment (no-changes)Agent reasoning |
donpetry-bot
left a comment
There was a problem hiding this comment.
Automated review — APPROVED ✓
Risk: MEDIUM
Reviewed commit: 7396ce74ef45daa9ea6591d8967a7df09922417e
Review mode: triage-approved (single reviewer)
Summary
Adds a second cron slot (:47) to the dry-run budget poller, raises the default staleness window from 3h to 6h (still overridable), and records trigger/scheduled-slot/start-delay fields so tick delivery can be measured. The fleet monitor now reports runs received in 24h against the 48 expected. Schedule-only, read-only permissions, and the single existing secret are all unchanged. The triage-approved assessment holds.
Linked issue analysis
Closes #2160. All four scope items and all four acceptance criteria are addressed:
- AC1: a yq-based static test asserts exactly two crons,
scheduleas the only trigger,contents:read,actions:readpermissions with no job-level or write scopes, and onlyCLAUDE_CODE_OAUTH_TOKEN. - AC2: tests cover the 6h default and the
BUDGET_POLLER_STALE_HOURSoverride. The dependent retry-cron test intest_dev_lead_retry_budget_hold.batsis updated, with the reason stated in a comment. It also gains FRESH-at-default and STALE-at-3h cases. - AC3:
bp_build_recordtests cover the scheduled fields, previous-hour aliasing, null for non-hourly or invalid crons, an end-to-end run, and carry-forward of pre-#2160 records. - AC4: the ShellCheck and bats checks are green.
- The AGENTS.md rationale for 6h is present, and so is the interaction-model table update.
Findings
No blocking findings.
- Security:
github.event.scheduleis passed throughenv:(BUDGET_POLLER_CRON), not interpolated intorun:, so there is no injection surface. No new secret, no new trigger, no permission change.concurrency: budget-pollerwithcancel-in-progress: falseprevents overlap between the two slots. - Correctness: the jq
scheduled()def safely yields null for non-matching or >59 minute crons, viacapture(...)?+select+// null. The median inbp_delivery_linenow averages the two middle values for even samples, and a test pins this (600/1200/1800/3600 -> 25m).bp_delivery_lineis best-effort (|| true) and handles a missing log. - Prior threads: all 5 review threads are resolved. These include the maintainer's required update to the retry-hold test, which was verified at this head. The
ack-test-deletionlabel covers the intentional edits to existing staleness tests (seeds moved from 4h/5h to 7h for the new default). - Nit (non-blocking): the retention comment changes from 720 records (~30 days) to ~15 days at two slots an hour. At ~40% delivery the real span will be longer; this is documentation only.
CI status
All required checks pass: Lint, ShellCheck, shellcheck, bats, unit, unit-tests, CodeQL, SonarCloud (quality gate passed), gitleaks, actionlint, AgentShield, and the stub/permissions guards. cubic is NEUTRAL (advisory; it says all reported issues were addressed). Skipped jobs are not applicable to this PR. The MCP secret-scanning tool is not available in this run, but the gitleaks check is green.
Reviewed automatically by the PR-review agent (single-reviewer mode: opus 5.5 [opus 4.8, opus 4.7]). Reply if you need a human review.
Dismissing approval due to a PR issue comment lacking a verified disposition (#1813)
|
No description provided. |



Problem
GitHub drops about 60% of scheduled ticks here: give the budget poller a second cron slot and a staleness window that matches
From the issue: The dry-run budget poller (
.github/workflows/budget-poller.yml, merged in PR 2031) is scheduled hourly (17 * * * *) and is schedule-only by design (noworkflow_dispatch, because a manual dispatch could run branch code that receives the Claude token). Its liveness rule warns when no OK record is newer thanbp_stale_hours(default 3 hours), and the retry cron (#2139) ignores a record older than that same bound.Risk
Medium — changes GitHub Actions workflow behavior, which is exercised only post-merge; verify via the affected workflow runs.
Test plan
Tests added/updated:
tests/dev-lead/unit/test_budget_poller.bats. Verification:bash scripts/dev-lead-lint.sh(shellcheck --severity=warning) ran pre-commit; the bats suite runs in CI.Rollback
Revert this PR. No non-revertible side effects (no tags, migrations, or external state).
Monitoring
Watch the affected workflow run(s) in the Actions tab and this PR's Lint check for regressions.
Closes #2160