Skip to content

fix(android): point foreign ANR refusals to alert, and read ANR buttons by id - #5115

Open
kdy1 wants to merge 33 commits into
callstack:mainfrom
kdy1:fix/android-anr-dialog-buttons
Open

kdy1 wants to merge 33 commits into
callstack:mainfrom
kdy1:fix/android-anr-dialog-buttons

Conversation

@kdy1

@kdy1 kdy1 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

While another package's "isn't responding" dialog has focus, the guard refuses screen commands, and its hint named only wait, restart, or reboot. alert passes the guard, but nothing pointed there, and it found the dialog by English text only.

  • The refusal hint names alert dismiss (Close app) and alert accept (Wait).
  • alert also finds the dialog by its android:id/aerr_close and aerr_wait buttons, mapped to dismiss and accept, in any language.
  • The daemon finds the dialog and Close app by the same ids; its English patterns are removed.

Before / after

System UI frozen with SIGSTOP until its ANR dialog has focus, API 36 emulator:

Call Base 24f8181c3 Head 6b57b4245
press @e2 hint wait, restart, or reboot alert dismiss or alert accept
alert accept refused presses Wait

Validation

Emulator run at 6b57b4245:

# agent-device 6b57b4245, e2e_api36_anr (API 36), System UI stopped with SIGSTOP
$ adb shell dumpsys window | grep mCurrentFocus
mCurrentFocus=Window{3f1f281 u0 Application Not Responding: com.android.systemui}
$ agent-device snapshot -i
@e1 [text] "System UI isn't responding"
@e2 [button] "Close app"
@e3 [button] "Wait"
$ agent-device press @e2
Error (COMMAND_FAILED): Android system dialog is blocking press: Application Not Responding: com.android.systemui (package com.android.systemui). May have reached the device. Next: Run snapshot to check the screen before you retry. Run alert dismiss to close the app that is not responding, or alert accept to wait for it, then retry.
$ agent-device alert dismiss
Alert dismissed
$ adb shell dumpsys window | grep mCurrentFocus
mCurrentFocus=Window{72304c4 u0 com.android.settings/com.android.settings.Settings}

A second ANR:

$ agent-device alert get --json   # data.alert
{"title": "System UI isn't responding", "buttons": ["Close app", "Wait"], "platform": "android", "source": "system-dialog", "packageName": "android"}
$ agent-device alert accept
Alert accepted
$ adb shell dumpsys window | grep mCurrentFocus
mCurrentFocus=Window{40a3a4c u0 com.android.settings/com.android.settings.Settings}

pnpm check:affected --run --head 6b57b4245, exactCommit: true:

[passed] format; exit=0
[passed] lint; exit=0
[passed] typecheck; exit=0
[passed] layering; exit=0
[passed] fallow; exit=0
[passed] build; exit=0
[passed] vitest-related; exit=0
[passed] unit; exit=0
[passed] command-docs; exit=0
[passed] docs-links; exit=0
[passed] docs-prose; exit=0
  • As on main, a refusal still says "May have reached the device".
  • The daemon needs Wait to call a dialog an ANR: the crash dialog also has Close app.
  • Not run on a device: another language (unit tests only), and Android below 7.0 (no aerr_ ids).

🤖 Generated with Claude Code

kdy1 and others added 19 commits November 26, 2026 10:16
When another package (for example System UI) shows "isn't responding",
the blocking-dialog guard refused every command, including a press on the
dialog's Close app or Wait button, so the dialog could not be dismissed.

A single press or click is now admitted when its final tap point lies
inside one of the framework app-error dialog buttons (android:id/aerr_*)
that are visible and not covered. Every other input is still refused with
dispatched: no. After the admitted tap, the guard waits for the dialog
focus to clear before its after-command check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on tap

The dialog-button exception read the button rectangles at the readiness
check, before target resolution. If the dialog closed in between, a tap
at a stored button point reached whatever the dialog uncovered and was
reported as a success.

The gate now reads the focus again immediately before the send. When the
dialog no longer has focus, the tap is refused with dispatched: no.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…utton tap

Android removes the app-error dialog window asynchronously, so the first
focus reads after the tap can still show it. No test held the wait that
covers this: the press fixture cleared the focus at the tap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialog-button exception still required the English "isn't responding"
title in the snapshot. On a device in another language, the guard
detected the ANR window from its fixed window title, but found no
buttons, so a press on the dialog's own Close app button stayed refused.

The focus read already identifies the ANR window, so the buttons are now
found by their framework resource id alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ts hit area

The dialog-button exception used the shared inclusive containsPoint, so a
raw-coordinate press on the pixel just past a button's right or bottom
edge was admitted. Android's view hit test excludes those edges, so the
tap reached the dialog around the button and closed nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ommand

ADR 0039 requires dispatched: no for a refusal before any send. The
blocking-dialog guard's before-command refusal for a foreign dialog left
the field unset, so the request disclosure layer reported dispatched:
unknown for a mutating command, while the dialog-button gate's own
refusal of the same press already reported no.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…older tree

The dialog-button exception checked only the tap point. An app @ref from
a snapshot taken before the ANR dialog appeared resolves on that older
tree. When its point fell on Close app or Wait, the gate admitted it, the
tap closed the dialog, and the response reported a press of the app's
own control.

The gate now also requires the point to be a dialog button in the tree
the target was resolved on. A raw coordinate has no such tree and keeps
the point-only check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…og-button tap

The focus read just before a dialog-button tap reported a probe that
answered nothing as "lost focus", although the dialog may still be up.
A read that threw (for example, the device went offline) reached the
request disclosure layer as dispatched: unknown, although nothing was
sent.

An unanswered read now says that focus could not be read, and a thrown
read is disclosed as dispatched: no. Tests also cover a different dialog
taking the focus before the send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The alert handler recognizes the app-error dialog by its English labels
only, so on a device in another language `alert dismiss` finds no alert.
A press on one of the dialog's buttons works in every language, so the
hint names only that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the snapshot read for the dialog's buttons failed, the tap was
refused like a dialog without buttons, and the read error was dropped.
The refusal stays, and the read failure is now recorded as a diagnostic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…its or refuses

Only a repeated press was tested. A double tap and a multi-ref plan are
refused for the same reason, and click is admitted like press; a change
that dropped any of these checks passed every test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… trees

The check against the tree a target was resolved on accepted any
app-error dialog button at the point. When the dialog's buttons moved
after the snapshot, for example after a rotation, a Wait ref whose old
point now lies on Close app was admitted, and the tap killed the app
that the agent meant to wait for.

Each admitted button now keeps its framework resource id, and the button
at the point must have the same id in both trees.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssed

Every foreign-dialog refusal told the agent to press Close app or Wait.
When the guard found no button to admit, every such press is refused
the same way: before Android 7.0 the dialog's buttons carry no aerr_ ids
(the snapshot helper supports API 23), and a failed snapshot read admits
no button. The agent then looped on the same refusal.

These two refusals now keep the earlier recovery hint: wait, close the
dialog, restart the app, or reboot the emulator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…al time

The test for the wait after a dialog-button tap slept through two real
500 ms focus polls. The repository keeps unit tests off real time, so the
file now mocks the poll's sleep, as the replay-divergence tests do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A single click or press can now close another app's "isn't responding"
dialog, while every other input stays refused. Neither the press and
click help nor the command reference said so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The conditional spread that handed admitTap to the interaction runtime
raised dispatchRuntimeInteraction's cognitive complexity to 16, over the
fallow limit of 15. The runtime already treats an undefined admitTap as
absent, so pass the optional value directly.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The press note added for a foreign ANR dialog raised the always-loaded
MCP tools to 23,180 bytes, over the 23,040-byte budget, and repeated a
search keyword. Shorten it to one clause without words from the search
hints. The refusal hint still tells the agent which buttons it may press.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A press the foreign-dialog guard refused, such as a stale Wait ref after
a rotation or an app ref from before the dialog appeared, got the hint
"Press one of the dialog's buttons", which the agent believes it just
did. Start the hint with a new snapshot so the next press uses a current
ref.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The paragraph said every command refuses while the dialog has focus,
but snapshot, screenshot, open, and close still run, and the same
paragraph tells the reader to take a snapshot. Name the input commands
instead.

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

@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.

All reported issues were addressed across 10 files

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

@thymikee

Copy link
Copy Markdown
Member

Thanks for the fix. At db76959, an open high-priority thread still needs a change: dialog button allowlist.

The answers to these questions decide whether the change fits the project:

  • Which real use case hit a foreign ANR dialog, other than a SIGSTOP reproduction? Can you link a report?
  • fix: recover Android app-owned ANRs #592 kept foreign ANRs fail-fast to avoid closing other processes. Why should a caller close System UI instead of waiting or restarting the emulator?
  • Cloud provider sessions skip this guard. Which non-provider setup needs this exception?
  • Would admitting only aerr_close/aerr_wait, checked on the resolved node, cover your case with less code?

Could the check run once, before dispatch, on the resolved node, while keeping readAndroidBlockingSystemDialogReadiness? For a single plain press or click (count 1, no doubleTap, holdMs or jitterPx, one ref), it would admit only a target whose identifier is android:id/aerr_close or android:id/aerr_wait, then run confirmFocus right before send. For raw coordinates, it would check that the matching button rect in the fresh capture contains the point. Could this drop the dual-tree point comparison, the generic admitTap seam on InteractionRuntimeInput and the tap counter, since the shape check guarantees one tap? It would also narrow the pattern to the two buttons the issue names. Could the app-owned recovery reuse the same id reader, so ANDROID_CLOSE_APP_PATTERN can be deleted?

These other high-priority threads also still apply: refusal test assertions, post-tap app check, refusal hint wording, and hold and jitter. This wording thread does not apply and can be resolved, because "tap" accurately describes the single press that is admitted.

The required evidence is in place. The live emulator run and check:affected results are author-reported, with no output attached, and the run induced the ANR by sending SIGSTOP to System UI.

Not verified here: device behavior (this was a read-only review); whether Android captures during a foreign ANR return nodes from the underlying app window, which affects whether the first thread's case is reachable in production; and which aerr_* buttons a real image shows in the ANR dialog.

The only non-passing CI jobs are two cancelled Body rules runs. This is likely unrelated to the code, since that check reads the PR description and such runs are typically replaced after description edits. Their logs were not available, so a fresh Body rules run at this head would confirm it.

Before merge, the dialog button allowlist thread must be resolved.

@kdy1

kdy1 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

This text was drafted with AI and posted after human approval.

  • Harnesses: T3 Code, Claude Code
  • AI agent: Claude Opus 5.5 (claude-opus-5-5)

Thanks for the review. Answers to your questions:

  1. Real case. A user report from e2e 0.17.0, which drives agent-device through MCP on a local Android emulator. System UI showed "isn't responding", and every press failed with Android system dialog is blocking press, including the agent's press on Close app. Restarting adb, rebooting, and cold-booting the emulator did not clear it. The report is in a private channel, so I can't link it. The SIGSTOP run is only how I reproduced the dialog locally.
  2. Why close System UI. In that report, waiting and the restart/reboot steps in the hint did not help, so the agent had no way forward. Close app on a System UI ANR kills System UI, and Android restarts it at once; in my run, Settings got focus again. This is the same action a person takes on the device, and Wait stays available. agent-device still never closes a foreign process by itself: the caller must press the button, and fix: recover Android app-owned ANRs #592's automatic recovery stays limited to the session app.
  3. Setup. A local emulator or device driven through the local daemon, which is where the report came from. Cloud provider sessions are not affected.
  4. Only aerr_close/aerr_wait. Yes, that covers the case. During the ANR on the API 36 image, the capture held one window and three nodes (alertTitle, aerr_close, aerr_wait), with no nodes from the app underneath.

I'll rework it the way you describe:

  • One check before dispatch on the resolved node, for a single plain press or click: count 1, no doubleTap, holdMs, or jitterPx, and one ref.
  • Only aerr_close and aerr_wait are admitted. For raw coordinates, the point must be inside one of those button rects in the fresh capture.
  • confirmFocus runs right before send, and readAndroidBlockingSystemDialogReadiness stays.
  • This drops the dual-tree comparison, the admitTap seam, and the tap counter.
  • The app-owned recovery will use the same id reader, so ANDROID_CLOSE_APP_PATTERN can go.

The same push addresses the other threads, and I'll attach the emulator and check:affected output to the PR body.

@thymikee

Copy link
Copy Markdown
Member

Thanks, this answers the fit questions. A System UI ANR on a local emulator that blocks every press, including the press on its own Close app button, with no way out through restart or cold boot, is a real dead end, and keeping the caller in control of that press preserves the #592 rule that agent-device never closes a foreign process by itself.

The smaller shape described above covers it: one check before dispatch on the resolved node, only aerr_close and aerr_wait, single plain press or click, confirmFocus right before send, and the shared id reader replacing ANDROID_CLOSE_APP_PATTERN. The next push will be reviewed against that shape and the open threads, together with the emulator evidence.

kdy1 and others added 7 commits November 26, 2026 13:00
…atch

The dialog-button exception checked the tap point inside the backend,
through an admitTap seam on InteractionRuntimeInput, compared the point
in two trees, and counted taps. Review asked for a smaller shape.

The check now runs once in readiness, before dispatch. It admits only
the ANR dialog's Close app and Wait buttons (android:id/aerr_close and
android:id/aerr_wait) in a fresh capture. A ref must name one of them,
and the button with the same id must contain the ref node's center, so a
ref read before the dialog appeared, or a Wait ref whose stored position
now shows Close app, is refused. A raw point must be inside either
button, and a selector is refused. The focus is then confirmed once more
before the command runs. The admitTap seam, the dual-tree comparison,
and the tap counter are gone: the press shape check already guarantees
one tap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dialog-button exception admitted a press with --hold-ms or
--jitter-px. A hold is not the single tap the exception allows, and
jitter can move the contact off the checked button. Admit only a press
with neither.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A press admitted on a foreign ANR dialog skipped the check that the
session app is still in front. Closing the dialog can reveal the
launcher or another app, and that check is what reports it. Run the
check after a dialog-button press too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…efusal

The refusal's default hint said to press a dialog button ref. Only a
press or click can reach the buttons, so a swipe, fill, or generic
command got advice it cannot follow. Keep the recovery steps as the
default and pass the dialog-button hint only from the press path.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The refusal cases checked only dispatched: no and that no tap was sent,
so an unrelated refusal could make them pass. Assert the focused
package and window as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The press exception now admits only Close app and Wait, by ref or by
coordinates, and refuses a hold, jitter, and a selector. Say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The foreign ANR dialog check looked the ref up in session.snapshot, but
the runtime taps the ref's node in the authorized ref frame (ADR 0014),
and a find match taps its own node. A read after the dialog appeared,
such as a screenshot, replaces session.snapshot without a new frame. A
ref issued on the app screen could then pass the check as Close app and
tap the app's button, which nothing checked. Read the node the runtime
will tap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kdy1 and others added 3 commits November 26, 2026 13:09
The comment said the focus is read again just before the tap is sent.
It is read as the last step of readiness, before ref resolution and the
send.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ANR dialog (AppNotRespondingDialog) names its Close app and Wait
buttons android:id/aerr_close and android:id/aerr_wait, not
android:id/button1..3. The helper's content classifier and alert
detection knew only button1..3, so a capture that held only the ANR
dialog was classified as system windows only. Recognize both ids, and
model the provider fixture's ANR dialog with them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
App-owned ANR recovery matched the English "Close app" label, so it
could not recover on a device in another language. Read the button by
android:id/aerr_close through the same reader as the press exception,
and delete ANDROID_CLOSE_APP_PATTERN. The unit fixtures now carry the id
the real dialog has.

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

kdy1 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

This text was drafted with AI and posted after human approval.

  • Harnesses: T3 Code, Claude Code
  • AI agent: Claude Opus 5.5 (claude-opus-5-5)

Pushed the rework at 0f047ad, in the shape you described. Each commit maps to one item:

  • 45b7fa1: one check before dispatch on the resolved node, only aerr_close/aerr_wait, raw points checked against the fresh rects, and selectors refused. The admitTap seam, the dual-tree comparison, and the tap counter are gone.
  • 575cfca: from a self-review. The check reads the ref's node from the authorized ref frame, the tree the runtime taps from, not from session.snapshot. Otherwise a screenshot taken after the dialog appeared could make an app ref pass as Close app.
  • 3d44215 and 0f047ad: app-owned recovery now uses the same id reader, and ANDROID_CLOSE_APP_PATTERN is gone. This needed the helper's content classifier and alert detection to recognize aerr_close/aerr_wait, which they did not: they knew only android:id/button1..3. A capture holding only the ANR dialog was classified as system windows only. The provider fixture now models the dialog with the real ids.
  • 47385f2, 93bbc98, 7ac2567, 75e0e34: the open threads, with replies in each.

The PR body has the emulator run and the check:affected output at 0f047ad.

@thymikee

Copy link
Copy Markdown
Member

Thanks for the follow-up. The points from the earlier review are resolved at 0f047ad, and no further code changes are needed.

These open threads no longer apply and can be resolved: the allowlist now holds only aerr_close and aerr_wait, matching the help text; refusal tests now assert typed details; the early return is gone, so the stayed-in-app check runs and a test covers the launcher-under-dialog case; the default hint is the recovery hint again, with the dialog hint passed only from the press/click tap path; hold and jitter presses are now excluded; and the tap wording is accurate because the admitted action is a single tap.

The emulator behavior and check:affected results rest on the transcripts in the PR. Not verified here: those runs were not repeated; it was not confirmed on a device that readAppState right after the tap resolves the underlying activity instead of the ANR window (the parser requires a package/activity component, which the ANR window title lacks); and alert accept or alert dismiss on a foreign ANR dialog was not traced end to end, although the alert detection pattern now classifies the aerr buttons.

The Body rules check was cancelled and the other 15 checks pass. The cancellation is likely unrelated to the code, since that job only reads the PR description; its log was not available.

Before merge, Body rules needs a fresh green run on this commit.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@thymikee

Copy link
Copy Markdown
Member

Thanks for the rework. A closer look at how Android system dialogs are handled shows a smaller path that also covers more cases, so please reshape this before it moves forward.

alert already owns Android system dialogs, and the blocking-dialog guard already lets it through. On main, alert get reads a foreign "isn't responding" dialog and alert dismiss taps Close app (see test/integration/provider-scenarios/android-alert.test.ts). What is missing is that the guard never points callers there, and alert finds the dialog and its buttons by English text only. A second, press-only route to the same Close app button adds a parallel hit test, focus check and press-pipeline options for something alert already does.

Please change the PR to:

  • Keep the id-based work: the aerr ids counted as alert buttons, the Close app lookup by id, the fixture correction and the snapshot-content test.
  • Make the guard's refusal for a foreign ANR name the recovery: alert dismiss closes the app, alert accept waits.
  • Teach alert the ANR buttons by id: android:id/aerr_close maps to dismiss and android:id/aerr_wait maps to accept, and recognise the dialog by those ids as well as by text, so it works in any language.
  • Remove the English "isn't responding" and "Close app" text patterns in the daemon that the id reader replaces.
  • Drop the press admission path and its plumbing (admitTap, the pre-dispatch dialog-button check, the tap-shape checks and the dialog hint threaded through press/click).

That should be roughly +20/-30 production lines instead of about +312/-30. Please attach one emulator run on the System UI ANR repro showing the refusal hint, then alert dismiss (or alert accept) clearing the dialog, with the press-only route gone.

@thymikee thymikee removed the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 26, 2026
@kdy1

kdy1 commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Note

This text was drafted with AI and posted after human approval.

  • Harnesses: T3 Code, Claude Code
  • AI agent: Claude Opus 5.5 (claude-opus-5-5)

Thanks, that shape is smaller and covers other languages. I checked it against main:

  • alert has no blocking-dialog guard. The dialog in my repro matches its system-dialog detection: package android, title "System UI isn't responding", and two Button nodes, aerr_close and aerr_wait. So in English, alert dismiss should already press Close app. alert accept refuses today, because Wait has no accept role and the dialog has two buttons. The aerr_wait mapping fixes that.
  • In the e2e report, the agent saw Close app in the snapshot and pressed it. The refusal hint said only to wait, restart the app, or reboot. A hint that names alert dismiss gives the agent a way out without a second press route.

I'll reshape the PR to the list in your comment. Then I'll attach one emulator run on the same System UI ANR repro: the refusal hint, then alert dismiss clearing the dialog, with the press route gone.

kdy1 and others added 4 commits November 27, 2026 08:32
The maintainer review asked for the smaller path: `alert` already owns
Android system dialogs, and the blocking-dialog guard does not stop it.
A second, press-only route to the same Close app button added a hit
test, a focus check, and press-pipeline options for something `alert`
does already.

This removes the pre-dispatch dialog-button check, the tap-shape checks,
the dialog hint passed through press and click, and their docs and
tests. The app-owned recovery still finds Close app by its framework id.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The daemon found the ANR dialog by English text ("isn't responding") and
Close app by its English label. On a device in another language the
recovery found neither. The framework ids do not depend on the language:
Close app is `android:id/aerr_close`, and Wait, `android:id/aerr_wait`,
is only in the ANR dialog, since the crash dialog also has Close app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`alert` found the "isn't responding" dialog by its English text only,
and gave Wait no role, so `alert accept` refused it. The dialog's
buttons have framework ids that do not depend on the device language:
`alert` now finds the dialog by them too, and maps
`android:id/aerr_close` to dismiss and `android:id/aerr_wait` to accept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
While another app's "isn't responding" dialog has focus, the guard
refuses every command that acts on the screen, and its hint said only to
wait, restart the app, or reboot. In a reported case none of these
cleared it. `alert` is not stopped by the guard and presses the dialog's
buttons, so the hint now names `alert dismiss` and `alert accept`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kdy1 kdy1 changed the title fix(android): let press reach a foreign ANR dialog's own buttons fix(android): point foreign ANR refusals to alert, and read ANR buttons by id Nov 26, 2026
@thymikee

Copy link
Copy Markdown
Member

Thanks for the rework. The code at 6b57b42 looks good, and nothing is left to fix from the earlier review.

The reshape is in: the press admission path for dialog buttons is gone, and the hint now points to alert, which every refused command can use. The live run of the foreign ANR route that the earlier review asked for is also in, so the required evidence is complete.

These earlier threads no longer apply and can be resolved: help text reverted, refusal tests deleted with the admission path, early return deleted, hint now names alert (code), press gate deleted, and tap wording removed by the revert.

Not verified here: the new unit and provider-scenario tests were not run locally. Non-English device behavior is covered by unit tests only, as the PR body says. It was not checked whether any supported Android version below 7.0, which has no aerr ids, exists; id-only recovery would not find Close app there. The English patterns were removed at the earlier review's request, so this is not a fault in the change. Session-app ANR auto-recovery through the aerr_close id was not shown on a device in this round.

All 16 checks show no failures at this commit. The change is ready for a maintainer's decision.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 27, 2026

This branch has not been deployed

No deployments
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.

2 participants