Repository navigation
fix(ios): use the caller's budget for alert get and type the watchdog outcome - #4540
Conversation
… outcome `alert get` on iOS sent the runner a fixed 10 s budget and ignored the timeout argument. It now spends the caller's window as the runner budget, clamped to 1.5-25 s (10 s when none is given). The 25 s ceiling also bounds each `alert wait` runner attempt, so a long wait polls instead of meeting the runner's 30 s main-thread watchdog. A watchdog expiry already surfaces as `runner_main_thread_timeout` with `dispatched: unknown`, distinct from ALERT_NOT_FOUND; a follow-up get waits out RUNNER_BUSY. Tests and help now state both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 7 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
… outcome Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Apex Sentinel · ✅ ApproveNo open findings. Reviewed with this repository's own Sentinel configuration ( 💬 Talking to SentinelIn a finding's thread, reply with:
On this conversation, comment |
|
The PR is ready at 00b1e98: I found no problems in the code, and all 22 checks pass with none failing or pending. There are no conflicts, so only the maintainer's merge decision remains. Not blocking, and you can take or leave each: the alert budget default, floor and 25 s cap are spread over two sites in alert.ts, so one small helper that owns all three would make the rule easier to see. On evidence: the live budget log and the Maps prompt read are author-reported, and I did not re-run them or any tests. No forced watchdog expiry was run live, and I did not trace Android's handling of the timeout. The four earlier inline threads from the other reviewer are fixed at this head, so the author can resolve them: #4540 (comment) (contract doc now matches the watchdog), #4540 (comment) ( |
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>
Summary
alert geton iOS now spends the caller's timeout as the XCTest runner budget instead of a fixed 10 s. Floor 1.5 s (ALERT_MIN_READ_BUDGET_MS), ceiling 25 s (newALERT_RUNNER_MAX_BUDGET_MS, below the runner's 30 s watchdog and the 90 s daemon envelope), 10 s when no timeout is given. The ceiling also bounds each runner attempt ofalert wait, so a long wait polls instead of hitting the watchdog.A watchdog expiry already reports
MAIN_THREAD_TIMEOUTasreason: runner_main_thread_timeout,dispatched: unknown, distinct fromALERT_NOT_FOUND; I reused it rather than addalert_state_unknown. A follow-up read-onlyalert getalready waits outRUNNER_BUSYor reports it; a test now pins that for alert.alert gethelp andcommands.mdstate the budget and outcome. 7 files.Cut: no new reason code, no Swift change (the runner already honored
timeoutMs), no change toaccept/dismiss.Closes #4523
Validation
Head: this PR's head commit, base
d78be6c887. Vitest onalert.test.ts,index-busy-resend.test.ts,command-descriptor-timeout-policy.test.ts: pass.pnpm typecheck, oxlint,pnpm format: clean. Wider vitest run ofpackages/command-surface,src/__tests__,test/repo-guards: onlyrelease-assetstimed out (5 s, host load). CI owns the full gate.Live, iPhone 17 simulator (iOS 27.0), worktree CLI with a temporary budget log (reverted):
alert get→ typedalert not found.get/get 3000/get 100/get 90000sent the runner 10000 / 3000 / 1500 / 25000 ms.alert get 3000read “Allow “Maps” to use your location?” with a 3000 ms budget.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.