Skip to content

refactor(alert): one helper owns the alert runner budget - #4563

Merged
thymikee merged 1 commit into
mainfrom
chore/alert-budget-followups
Nov 15, 2026
Merged

thymikee merged 1 commit into
mainfrom
chore/alert-budget-followups

Conversation

@thymikee

@thymikee thymikee commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Applies the non-blocking review notes on #4540 (#4540 (comment)). No behaviour change.

  • alertRunnerBudgetMs in packages/platform-apple/src/alert.ts now owns the default (10 s), the read floor (1.5 s) and the 25 s ceiling. Before, they were split between readAppleAlert and runAppleAlert. Every budget the runner receives is the same as before.
  • alertWaitTimeoutMs in snapshot-alert.ts is renamed to alertTimeoutMs, and its doc now says it also sets the alert get budget.
  • The hand-built watchdog test in alert.test.ts is removed. It only re-checked existing behaviour that other tests already cover.

Not taken: the optional live alert wait 30000 run on a simulator. The wait path is unchanged here.

Validation: vitest on alert.test.ts and the daemon execution handlers (101 tests) passes; typecheck, oxlint and oxfmt are clean. CI owns the rest.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

View guided diff Turn on auto-fix

Follow-up to #4540 review notes: alertRunnerBudgetMs owns the default,
floor and ceiling; alertWaitTimeoutMs becomes alertTimeoutMs since it
also feeds alert get; drop the hand-built watchdog test that only pinned
existing behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.30 MB 6.30 MB +31 B
Package (unpacked) 6.29 MB 6.29 MB +31 B
Package (download) 1.91 MB 1.91 MB +6 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 20.0 ms 21.3 ms +1.3 ms
CLI --help 40.2 ms 39.3 ms -0.9 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

You’re at about 94% 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.

View guided diff | Turn on auto-fix | Re-trigger cubic

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (89485f95282e).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

This PR is ready: I found no correctness problems at 11e3ab1, and all 20 checks pass with no open review threads. There are no conflicts. Nothing else needs to happen before merge. The runner-visible budgets are unchanged for every finite input, and the unit table test pins them at the runner client boundary. Not blocking, and you can take or leave these: runAppleAlert clamps a value that readAppleAlert already clamped, and awaitAppleAlert still spells its own ?? DEFAULT_ALERT_TIMEOUT_MS default, so the helper owns only the per-attempt budget; the removed test was the only one that fed MAIN_THREAD_TIMEOUT through the get path, so one short get-path watchdog case (or that error in the unresolved read test's list) would keep it covered; the doc comment in snapshot-alert.ts has one line past the 100-column wrap; and a library caller passing Infinity straight to awaitAppleAlert now gets 10 s per attempt instead of the 25 s cap, which no daemon, CLI or MCP route can produce.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 15, 2026
@thymikee
thymikee merged commit 26a8a1b into main Nov 15, 2026
20 checks passed
@thymikee
thymikee deleted the chore/alert-budget-followups branch November 15, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant