Skip to content

agent-device 0.21.40: read typed refusals, and press the dismiss control back names - #87

Open
thymikee wants to merge 7 commits into
expo:mainfrom
thymikee:agent-device-0.21.39
Open

thymikee wants to merge 7 commits into
expo:mainfrom
thymikee:agent-device-0.21.39

Conversation

@thymikee

@thymikee thymikee commented Nov 17, 2026 •

Copy link
Copy Markdown

Summary

We maintain agent-device, and we'd like Explore to use what it offers directly rather than work around it. When we find a gap that forces Explore into a workaround, we fix it in agent-device first, then send the matching change here.

This PR bumps agent-device from 0.21.29-nightly.20261018.74 to 0.21.40. Newer releases reword two error messages that Explore matches as text, so on a plain bump those fallbacks would quietly stop running. All three text checks now read the typed error.details.reason:

- if (!/in-app back control is not available/.test(error.message)) throw error;
+ if (!backLeftScreenUnchanged(error)) throw error;   // back_swipe_no_change
What Explore checks Reason it reads now
back on a screen with no back button back_swipe_no_change
keyboard dismiss refused (on iOS, any visible keyboard from 0.21.40) keyboard_dismiss_unavailable
remote daemon /health failed remote_daemon_unavailable with dispatched: "no", so a resend is safe

On iOS, back now only pops the navigation stack. On a modal whose only exit is a header Close button, agent-device names that button instead of guessing:

{ "reason": "back_swipe_no_change",
  "dismissControls": [{ "selector": "role=button label=\"Close\"", "label": "Close" }] }

Explore presses that button only when it's the only one listed and riskOf calls it safe. Back then succeeds only if the screen changes or the button disappears, and no alert appears. The other controller's bridge returns the same reasons. 13 files changed.

No visible change. No change to usage.

Validation

Tested at head b36e438 on a local iPhone 17 Pro simulator (iOS 27.0), with a 24-step explore:binary --replay of the Wallet example:

main (1de4213, pinned) this PR (0.21.40)
Steps 24/24 24/24
Required back on /topup closes the modal closes the modal
Failed actions 2 (both expected) the same 2

This PR captured one extra screen: the keyboard mid-typing on sign-up. npm run test:node: the new tests pass. The same 29 that fail on main also fail here, all in the comparator ("evidence comparison did not run"). Typecheck and lint pass. Your CI hasn't run yet, because this PR comes from a fork.

Also found: #88, where dismiss-keyboard can submit a form. 0.21.40 fixes the agent-device side; #91 fixes Explore's side.

🤖 Generated with Claude Code

…rol back names

0.21.39 no longer says "in-app back control is not available" or "Unable to dismiss the iOS
keyboard", so the fallbacks Explore keyed on those messages would never run. They now read
error.details.reason:

- back: on iOS, agent-device presses the navigation bar back button, else swipes from the left
  edge, and refuses with back_swipe_no_change when nothing changed. It lists the screen's dismiss
  controls (Close, Cancel, Back) in details.dismissControls without pressing them. Explore presses
  the one it names when its label is safe by Explore's destructive and external rules, requires
  the destination to change, and otherwise swipes a sheet down as before.
- keyboard dismiss refuses with keyboard_dismiss_unavailable; the return-key fallback keys on it.
- the remote /health refusal is remote_daemon_unavailable with dispatched "no", which is what
  Explore inferred from the message before resending.

The other controller's bridge gives the same reasons.

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

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T14:36:06.106758Z bee35eb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

devin-ai-integration[bot]

This comment was marked as resolved.

As in source-driven capture, explore:binary compares the screen before and after it presses the
dismiss control agent-device named, and fails the back with agent-device's refusal when nothing
changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ipes after a press

A modal kept in a screen's own state keeps the route when its Close control dismisses it, so the
destination check alone read that as a failure and fell through to the sheet swipe-down with the
geometry read before the press. A press now counts when the route changes or the pressed control
is gone. If neither happens, back fails with AGENT_DISMISS_CONTROL_FAILED instead of swiping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
devin-ai-integration[bot]

This comment was marked as resolved.

…eaving the screen

The pressed control disappearing counted as back, but a confirmation such as "Discard changes?"
also hides it while the screen stays. The control leaving now counts only when no alert took its
place; otherwise back fails with AGENT_DISMISS_CONTROL_FAILED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A "Discard changes?" confirmation after the press changes the screen, and can hide the route
observer, so either signal alone read it as having left. Both code paths now require that no
alert is showing before a press counts as back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
thymikee and others added 2 commits November 19, 2026 16:27
agent-device names a dismiss control by its identifier when it has
one, and its label may then be empty. The press check matched only
the label, so a button with no label was never seen and the press
counted as leaving even when the modal stayed. It now matches the
control the way agent-device named it, and the control leaving counts
only when it was on screen before the press.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
0.21.40 adds the keyboard fix found while testing this bump: keyboard
dismiss no longer presses the return key, so on a field whose return
key is Done it refuses with keyboard_dismiss_unavailable instead of
submitting the form. The typed reasons Explore reads are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@thymikee thymikee changed the title agent-device 0.21.39: read typed refusals, and press the dismiss control back names agent-device 0.21.40: read typed refusals, and press the dismiss control back names Nov 19, 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant