You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2482e24
Browse filesBrowse the repository at this point in the historyBrowse files
fix(alerts): scope alert captures to the warm helper and split the unconfirmed press
The executed Android smoke failure at 5b1e1c1: the session's alert probes
ran without the app-backed helper session scope, so each probe cold-started
the snapshot helper inside the window that bounds it — the request log shows
the post-press confirm capture aborted at 2.3s ("operation was aborted due
to timeout") while the canary proves the dialog was in fact dismissed. Alert
reads now carry the same helperSessionScope as every other app-backed read.
The failure also proved the wording lied: with no confirm capture ever
answering, "did not dismiss the visible alert"/"dialog is still visible"
accused a dialog that was already gone. Only a re-read naming the same alert
earns the still-visible failure; an unconfirmed press now says exactly that,
on both the cut-off and the spent-budget exits, with a hint to run alert get
before retrying. The same-alert stuck-alert failure keeps its message.
Pinned: interactor scoping regression (fail-before against 5b1e1c1) and
the three Limrun confirm-phase tests moved to the truthful split; the
Android still-visible pin keeps its message via the same-alert path.
@@ -505,23 +516,44 @@ async function confirmTreeAlertDismissed<
505
516
signal,
506
517
}));
507
518
}catch(error){
508
-
// A confirmation capture this phase cuts off says the same thing a budget spent without
509
-
// confirmation says — and it says it after a press landed, so the stuck-alert phrasing is
510
-
// the honest one here; the typed reason keeps the two causes distinguishable.
519
+
// A confirmation capture this phase cuts off says what the press cannot say alone: whether
520
+
// the dialog is still there, or whether the check itself never answered. Only the first is
521
+
// the stuck-alert failure; the second must not claim a visible dialog it never observed.
511
522
if(isAlertWindowExpired(error)){
512
-
thrownewAppError('COMMAND_FAILED',`alert ${action} did not dismiss the visible alert`,{
513
-
alert: dismissed,
514
-
reason: ALERT_WINDOW_EXPIRED_REASON,
515
-
hint: 'The alert button was pressed but the dialog is still visible. Inspect alert get --json, then press the visible button by label/ref or retry.',
516
-
});
523
+
if(sameAlertObserved){
524
+
thrownewAppError('COMMAND_FAILED',`alert ${action} did not dismiss the visible alert`,{
525
+
alert: dismissed,
526
+
reason: ALERT_WINDOW_EXPIRED_REASON,
527
+
hint: 'The alert button was pressed but the dialog is still visible. Inspect alert get --json, then press the visible button by label/ref or retry.',
528
+
});
529
+
}
530
+
thrownewAppError(
531
+
'COMMAND_FAILED',
532
+
`alert ${action} pressed the button but the dismissal could not be confirmed`,
533
+
{
534
+
alert: dismissed,
535
+
reason: ALERT_WINDOW_EXPIRED_REASON,
536
+
hint: 'The alert button was pressed; the post-press read never answered within the budget, so the dialog may already be gone. Run alert get --json before retrying.',
537
+
},
538
+
);
517
539
}
518
540
throwerror;
519
541
}
520
542
if(settled)return;
521
-
thrownewAppError('COMMAND_FAILED',`alert ${action} did not dismiss the visible alert`,{
522
-
alert: dismissed,
523
-
hint: 'The alert button was pressed but the dialog is still visible. Inspect alert get --json, then press the visible button by label/ref or retry.',
524
-
});
543
+
if(sameAlertObserved){
544
+
thrownewAppError('COMMAND_FAILED',`alert ${action} did not dismiss the visible alert`,{
545
+
alert: dismissed,
546
+
hint: 'The alert button was pressed but the dialog is still visible. Inspect alert get --json, then press the visible button by label/ref or retry.',
547
+
});
548
+
}
549
+
thrownewAppError(
550
+
'COMMAND_FAILED',
551
+
`alert ${action} pressed the button but the dismissal could not be confirmed`,
552
+
{
553
+
alert: dismissed,
554
+
hint: 'The alert button was pressed; no post-press read resolved to an answer within the budget, so the dialog may already be gone. Run alert get --json before retrying.',
555
+
},
556
+
);
525
557
}
526
558
527
559
/** Alert identity across a dismissal re-check: the same title and the same button row, in order. */
Copy file name to clipboardExpand all lines: website/docs/docs/commands.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -386,7 +386,7 @@ agent-device alert dismiss
386
386
- Polling wait timeouts, and a replayed wait refused with `wait_landmark_identity_mismatch`, also carry `captures`, `readableCaptures`, and `polls` so you can see where the budget went. Each poll has `startedMs`, `durationMs`, and an `outcome`: `readable`, `unreadable`, `retriable`, `deadline`, `runner-restart`, or `readiness`. Long waits keep the first 5 and last 25 polls. A wait that never saw a readable capture reports the error its polls hit, with that error's code and retry details, instead of a generic timeout; `wait stable` and a never-readable strict absence keep their own diagnostics. `logPath` links the full request log.
387
387
- `alert` (same as `alert get`) inspects or handles system alerts on iOS simulator, macOS desktop, and Android permission dialogs. On iOS it also covers app-owned modal popups with native blocking markers. `alert wait <ms>` takes a budget up to 2147483647 ms (~24.8 days); larger is refused as `INVALID_ARGS` before anything runs.
388
388
- On the snapshot-derived backends (Android, Limrun iOS) `alert get --json` answers with a typed `status`: `visible`, `none`, or `undecided` (an alert-shaped capture that resolves to no single alert). Branch on `status`, not on the message.
389
-
- On those backends, when `alert accept`/`dismiss` fails, `error.details.reason` names why. Before any press, `dispatched: no` and the reason is `alert-not-found` (the action budget passed with no alert seen), `alert-window-expired` (the budget closed before a capture or the press could resolve), `alert_capture_undecided`, or `alert_button_undecided` (the sheet is too ambiguous to act on). After a press, `alert-window-expired` with "did not dismiss" wording means the tap went out and the disappearance could not be confirmed; `dispatched: unknown` means the press itself was cut off and may have landed. Run `alert get` before acting again.
389
+
- On those backends, when `alert accept`/`dismiss` fails, `error.details.reason` names why. Before any press, `dispatched: no` and the reason is `alert-not-found` (the action budget passed with no alert seen), `alert-window-expired` (the budget closed before a capture or the press could resolve), `alert_capture_undecided`, or `alert_button_undecided` (the sheet is too ambiguous to act on). After a press, “did not dismiss the visible alert” means a re-read named the same dialog again; “could not be confirmed” means the press went out but no post-press read resolved in time, so the dialog may already be gone; `dispatched: unknown` means the press itself was cut off and may have landed. Run `alert get` before acting again.
390
390
- On Android, an alert capture that outlives its budget is stopped in flight. On Limrun the transport cannot cancel a request: the command refuses a late answer and presses nothing, but a hung capture can keep running after the command has already failed. If Limrun alert commands stall, restart the instance session.
391
391
- Use `alert get` for a quick check, and `alert wait <short-ms>` only when a prompt may appear after async work. Don't use `settings permission` to answer a dialog already on screen; it is for setup before a flow.
392
392
- `accept` and `dismiss` are sent once on every platform and never replayed, even if the response is lost. On iOS the runner activates the button once, then only observes until the alert disappears, changes, or the deadline expires. A changed alert does not prove a permission was granted; verify the app outcome.
0 commit comments