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
Ref errors after --settle cost agents commands, and swipe/gesture reject --settle #4571
Agents repeatedly misuse refs after --settle, and some interaction commands reject --settle. In a dogfood experiment, 18 of 36 runs reported ref errors. The ref model is by design, but the errors cost agents commands and several dropped probes.
Observed
After press @e15 --settle, the diff lists suffixed refs such as @e34~s157564. Then press @e34 fails: "Ref @e34 needs a complete snapshot — the current frame only authorizes its emitted refs". Other runs saw "expired ref frame" and "superseded".
swipe ... --settle and gesture ... --settle are rejected, while press and fill accept it.
One run skipped a probe ("Sort recipes A–Z") after a stale-ref failure.
Required behavior
swipe and gesture accept --settle, or the help states clearly why they do not, with the alternative.
When a bare ref is refused and the current frame has exactly one matching suffixed ref for the same node, the error prints that suffixed ref, ready to copy.
The skill routing card says in one line which refs are valid after a settle diff.
Completion conditions
swipe <x1> <y1> <x2> <y2> --settle prints a settle diff on iOS and Android, or fails with a typed reason that the help documents.
The refused-ref error includes the replacement ref when there is one.
The issue reports concrete failing behavior: bare refs after a settle diff are refused, and swipe/gesture reject --settle inconsistently compared to press/fill, with reproduction commands and environment details.
Scope declaration for an incoming PR from this fork: it takes the ref-error half of this issue, not the swipe/gesture --settle gap.
In the PR
Element-side ambiguity refusals: the gesture route (drag source/destination selectors) now runs the same ambiguity-issuance rule as press/click/fill and the strict reads — a refusal that prints candidate refs issues them on the frame that lists it, or prints none. The CLI render chain also re-pins every printed candidate to the epoch the caller will face, so a pasted ref is not refused as superseded. This extends the "replacement ref, ready to copy" standard of this issue's second required behavior to the ambiguity refusal's candidate list.
Device-side ambiguity refusals: the tied-device candidate list now carries each device's boot state beside its id and name, so the one-retry recovery picks an id that can actually answer.
Not in the PR (stays open here)
swipe/gesture accepting --settle, or the help stating why not (required behavior 1).
The skill routing-card line about which refs survive a settle diff.
More data on this from agent sessions: "needs a complete snapshot" was the single most common agent-device error we saw, in about 20 sessions across 5 setups. The usual chain is fill @e3 … --settle; press @e4, with @e4 taken from the earlier full snapshot.
When @e4 wasn't in the settle diff, the error doesn't offer a replacement ref, so agents re-run snapshot -i every time. It would help if the error said that the --settle diff replaced the frame and listed the refs it issued, or if refs that the diff left unchanged stayed valid.
Thanks — that matches the gap, and the frequency data (most-common error across ~20 sessions) strengthens the case.
#4853 landed the paste-ready candidate standard for the ambiguity route: a refusal that prints candidates issues them on the frame that lists them, re-pinned to the epoch the caller faces. The path you hit is a different error site: press @e4 with a ref the --settle diff left behind answers "needs a complete snapshot" and offers nothing, so agents pay a full snapshot -i every time.
The smallest slice that fixes it: when the ref is missing because a settle diff replaced the frame, the refusal names the settle diff as the replacement and issues replacement refs from the settle-diff frame (the same "replacement ref, ready to copy" standard as the ambiguity refusal). I'll take that as a follow-up PR slice.
"Refs the diff left unchanged stay valid" is the deeper fix, but it changes the ref-lifetime contract (which refs survive a frame replacement), so it is bigger than an error-message slice — leaving that call to the maintainers here.
Decision: gesture settle and ref lifetime: Keep ADR 0014 ref expiry and the paste-ready recovery from #5037. For the remaining slice, make settle an opt-in observation after the last successful swipe or gesture, through the existing settle engine and bound capture, using the current quiet and deadline semantics. Plain gestures keep their current capture budget. A failed or inconclusive observation reports that separately from the action outcome and issues no refs. Until this is covered on iOS and Android, use wait stable after the gesture, or a fresh snapshot -i when the next action needs refs.
Activity
apex-sentinel-staging commentedon Nov 15, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue reports concrete failing behavior: bare refs after a settle diff are refused, and swipe/gesture reject --settle inconsistently compared to press/fill, with reproduction commands and environment details.
Required sections
strzhao commentedon Nov 20, 2026
Scope declaration for an incoming PR from this fork: it takes the ref-error half of this issue, not the swipe/gesture
--settlegap.In the PR
Not in the PR (stays open here)
swipe/gestureaccepting--settle, or the help stating why not (required behavior 1).imranbarbhuiya commentedon Nov 23, 2026
More data on this from agent sessions: "needs a complete snapshot" was the single most common agent-device error we saw, in about 20 sessions across 5 setups. The usual chain is
fill @e3 … --settle; press @e4, with@e4taken from the earlier full snapshot.When
@e4wasn't in the settle diff, the error doesn't offer a replacement ref, so agents re-runsnapshot -ievery time. It would help if the error said that the--settlediff replaced the frame and listed the refs it issued, or if refs that the diff left unchanged stayed valid.strzhao commentedon Nov 23, 2026
Thanks — that matches the gap, and the frequency data (most-common error across ~20 sessions) strengthens the case.
#4853 landed the paste-ready candidate standard for the ambiguity route: a refusal that prints candidates issues them on the frame that lists them, re-pinned to the epoch the caller faces. The path you hit is a different error site:
press @e4with a ref the--settlediff left behind answers "needs a complete snapshot" and offers nothing, so agents pay a fullsnapshot -ievery time.The smallest slice that fixes it: when the ref is missing because a settle diff replaced the frame, the refusal names the settle diff as the replacement and issues replacement refs from the settle-diff frame (the same "replacement ref, ready to copy" standard as the ambiguity refusal). I'll take that as a follow-up PR slice.
"Refs the diff left unchanged stay valid" is the deeper fix, but it changes the ref-lifetime contract (which refs survive a frame replacement), so it is bigger than an error-message slice — leaving that call to the maintainers here.
fix(refs): name the settled diff in the plain-ref refusal and issue i…
fix(refs): name the settled diff in the plain-ref refusal and issue i…
thymikee commentedon Nov 25, 2026
Decision: gesture settle and ref lifetime: Keep ADR 0014 ref expiry and the paste-ready recovery from #5037. For the remaining slice, make settle an opt-in observation after the last successful swipe or gesture, through the existing settle engine and bound capture, using the current quiet and deadline semantics. Plain gestures keep their current capture budget. A failed or inconclusive observation reports that separately from the action outcome and issues no refs. Until this is covered on iOS and Android, use
wait stableafter the gesture, or a freshsnapshot -iwhen the next action needs refs.thymikee commentedon Nov 25, 2026
An agent is picking up the gesture-settle slice. The PR will link here and report the iOS and Android capture counts and timing evidence.