Skip to content

Ref errors after --settle cost agents commands, and swipe/gesture reject --settle #4571

Done

Description

@thymikee

Purpose

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.

Agent-device 0.21.31 (T3 bundled), iOS 26.2 simulator.

Activity

  1. added
    needs-triage
    on Nov 15, 2026
  2. apex-sentinel-staging commented on Nov 15, 2026

    @apex-sentinel-staging

    Apex Sentinel · Issue review

    Suggested label: bug

    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.

    Required sections

    • Steps to reproduce (missing)
    • Expected and actual behavior (missing)
    • Version or environment (missing)
  3. added
    enhancement
    and removed
    needs-triage
    on Nov 16, 2026
  4. strzhao commented on Nov 20, 2026

    @strzhao
    Contributor

    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.
  5. imranbarbhuiya commented on Nov 23, 2026

    @imranbarbhuiya
    Contributor

    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.

  6. strzhao commented on Nov 23, 2026

    @strzhao
    Contributor

    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.

  7. thymikee commented on Nov 25, 2026

    @thymikee
    MemberAuthor

    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.

  8. added
    in-progress
    on Nov 25, 2026
  9. thymikee commented on Nov 25, 2026

    @thymikee
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementin-progress

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions