Repository navigation
Conversation
…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>
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>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c442b3e59b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await command(["press", control.selector, "--level", "full", "--json"], signal); | ||
| for (let attempt = 0; attempt < 4; attempt++) { | ||
| await sleep(500, undefined, { signal: liveSignal(signal) }); | ||
| if (observerIdentity((await readSnapshot(signal)).snapshot.nodes) !== observerIdentity(before)) return { via: "dismiss-control" }; |
There was a problem hiding this comment.
Accept same-route dismissals after pressing the control
When the named Close/Cancel control dismisses a modal implemented as component-local state on the current route, the observer emitted by src/capture/observer.ts retains the same navigation label and rectangle, so this check never recognizes the successful dismissal. The press has already mutated the UI, but back then falls through to sheetDismissGesture(before) using stale pre-press geometry or throws the original refusal; the agent records a failed action and may retry or derail the capture. Verify the actual accessibility/modal state in addition to observerIdentity before reporting failure.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch. This code comes from #87 (this PR stacks on it), so I fixed it there in d18339d, and this branch is rebased on it. A press now counts as back when the route changes or when the pressed control is gone from the screen. That covers a modal kept in a screen's own state. If neither happens, back fails with AGENT_DISMISS_CONTROL_FAILED and never falls through to the sheet swipe, because the press may already have changed the UI. Two tests in ci-map.test.mjs cover the same-route close and the "pressed, nothing changed" case, which asserts that no swipe follows.
…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>
c442b3e to
379a04c
Compare
…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>
379a04c to
574fd18
Compare
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>
574fd18 to
aec1709
Compare
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>
aec1709 to
4b1abc4
Compare
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>
The local Android path counted every claim and every hidden stale claim on a serial and skipped the port when the count was above zero, because agent-device refused some stale claims. device status now answers the question itself: devices[].acquirable says whether a new session could take the device, and blockedBy names the reason. Explore skips a port only when that verdict is false. A claim whose owner died is reclaimable, so its port is no longer skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4b1abc4 to
4d96f81
Compare
Summary
We want Explore to use agent-device directly, without workarounds. This removes one: counting claims to guess whether agent-device would refuse a port.
agent-device's
device status --jsonnow answers that question itself (devices[].acquirable, withblockedByas the typed reason). Explore reads it instead of addingclaims.length + hiddenStaleClaims.Before: skip the port if
claims.length + hiddenStaleClaims > 0.After: skip the port if any
devices[].acquirable === false.{ "claims": [], "hiddenStaleClaims": 1, "devices": [{ "acquirable": false, "blockedBy": "owner-process-still-running" }] }One behaviour is more correct: a stale claim whose owner died is reclaimable, so its port is no longer skipped. Claims agent-device still refuses stay skipped.
4 files changed. No visible change. No change to usage.
Stacked on #87: review after it. The diff includes #87's commits until it merges.
Validation
emulator-5570) with 0.21.39. The claim inspection behinddevice statusis the same in 0.21.40.device status --jsonin four states: no claim (devices: []), live owner (acquirable: false,live-owner), dead owner (acquirable: true, andopenfrom another state dir succeeded), owner state dir gone (hidden as stale,acquirable: false, andopenfailed withDEVICE_IN_USE).agentDeviceRefuses.build,typecheckandeslintpass.test:node: 1687 pass, 29 fail, all "required evidence comparison did not run" (same as main). One test added for the reclaimable claim.🤖 Generated with Claude Code
🟢 Devin Review found nothing to fix · View findings