Skip to content

evidence: show the agent cursor as a view-time overlay #199

Closed

Description

@ElbertePlinio

Why

Users want to see where the agent moved, clicked, dragged or tapped. Today that is only visible when maim happens to be the screenshot tool (it blends the X cursor into Xvfb captures); the import, xwd and scrot fallbacks drop the cursor, browser sessions never have one because CDP input moves no pointer, and Android "Show taps" ignores adb shell input tap (Google issue 247152539, still open).

Managed sessions no longer touch the real pointer since #16 (Wayland env poisoned, owned Xvfb only). This issue does not change input at all.

Design

Draw the marker at view time from the recorded action, never into the captured PNGs. Screenshots the model receives and the MCP tool results stay byte-for-byte unchanged, so the feature costs the agent zero tokens. Captures stay untouched for hashes, redaction and re-inspection.

v1 is desktop only. Browser and Android markers need coordinate contracts that do not exist yet (see non-goals). Polish is tracked in #200.

Revised 2026-09-25 after an independent Astra review of the plan. Cuts: cursor theming (would change the pixels maim captures, breaking the unchanged-model-frames promise), a DISPLAY string test (wrong invariant), and a new status field (session status already prints the display).

Checklist

  • Action producers record what a marker needs: both drag endpoints (today packages/mcp-server/src/tools/desktop.ts stores only the destination), an explicit action-to-image association for the before/after captures, capture phase, and per-image dimensions. The CLI click and drag paths append action records too. Never infer that the next screenshot belongs to an action.
  • SanitizedActionTarget in packages/core/src/evidence-sanitize.ts gains a coordinate space (xvfb-root for v1); malformed or missing values are dropped, never guessed. New fields stay out of MCP tool responses.
  • Evidence viewer (packages/core/src/evidence-render.ts) overlays a hollow ring at the recorded point and a start-to-end line for drags on the explicitly associated screenshots, rendered against the displayed image rectangle (letterboxing and actual-size mode). Static SVG/CSS inside the existing report, offline CSP preserved, overlay toggle, older or incomplete records stay unmarked. Attempted and completed input are distinguished.
  • Isolation regression test compares the input target against the session's owned Xvfb process and socket identity (see packages/desktop-linux/src/display.ts ownership tracking and input.ts explicit display), covering mismatched ownership, dead or recycled servers, and inherited host endpoints, with mocked commands or throwaway displays.
  • Tests for sanitization and viewer geometry; bun run typecheck, bun run test, bun run test:coverage green.
  • Ship behind an @pickforge/flags default-off flag only if it merges before its enabling release; label flagged and remove the flag as part of the feature. Not needed: the feature was complete at merge in feat(evidence): show the agent pointer as a view-time overlay #218 and ships enabled in the next release.
  • docs/releases/UNRELEASED.md entry.

Non-goals

Evidence

Verified locally on a throwaway Xvfb (XFIXES present): maim blends the cursor, maim --hidecursor and import -window root do not, ffmpeg x11grab -draw_mouse 1 does. x11vnc sends cursor shape and position to viewers by default.

Refs #16, #117, #155, #200. Live viewing is #207.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions