Skip to content

docs(mcp): say that an after capture can precede the redraw - #417

Merged
ElbertePlinio merged 3 commits into
mainfrom
docs/223-after-capture-redraw
Oct 28, 2026
Merged

ElbertePlinio merged 3 commits into
mainfrom
docs/223-after-capture-redraw

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

MCP input tools take the after capture as soon as input completes, so it can show the screen before the app redraws. An agent could read that unchanged PNG as a failed input and retry it.

This change documents the limit instead of adding a settle. The shared capture description on the MCP input tools and the README now say that an unchanged after capture does not prove the input failed. With capture: "both", they point to desktop_wait with baseline set to the before capture's path. The README also says that reason: "timeout" does not prove a failure, because some input changes nothing on screen. Capture timing is unchanged.

No device pass: the change is tool description text and README prose, with no new behavior to drive. The existing live test desktop-input-captures-live.test.ts already runs this recipe against a real Xvfb, and it passed after the rebase on main.

Reviewed with sol-loop: 2 rounds with GPT-6.1 Sol (high). Sol verdict: approved.

Round 1 found that the recipe needs a before PNG, which capture: "after" does not make (S1), and that desktop_wait also returns a timeout when input has no visible effect (S2). Both were fixed in the text.

Closes #223

Requirement Verified by Scenario and edge cases Result Evidence
Choose documentation or an opt-in settle Decision in this PR A settle adds a fixed delay to every captured input and still cannot know when the app is done Documentation chosen this PR
Implement it Unit test on every input tool schema desktop_click, desktop_double_click, desktop_drag, desktop_move, desktop_scroll, desktop_key, desktop_type Each description names the desktop_wait baseline recipe; the test fails for all 7 tools on main packages/mcp-server/test/desktop-input-captures.test.ts
README explains the limit and the recipe Review, Sol rounds 1 and 2 capture: "after" has no before PNG; a timeout with no visible change Text requires capture: "both" and says a timeout is not a failure README.md capture section
Cover it with a test Unit and live tests Recipe run against a real Xvfb in the existing live test 101 tests pass after rebase on main desktop-input-captures.test.ts, tools.test.ts, desktop-input-captures-live.test.ts
Release note Pending docs/releases/UNRELEASED.md still holds the tagged 0.7.1 notes until they are published and reset Text below, added after the reset this PR

Release note for the next version: "The MCP input tool descriptions and the README now say that an after capture can precede the app's redraw, and show how to wait for the change with desktop_wait. (#223)"

Checks: focused vitest suites above, bun run typecheck, bun run lint, PickCheck (no new or worsened violations).

MCP input tools take the after capture as soon as input completes, so under load it can show the screen before the app redraws. An agent could read that as a failed input and retry it. The capture description and the README now say so and point to desktop_wait with the before capture as the baseline. Closes #223.
@ElbertePlinio
ElbertePlinio merged commit f88fe97 into main Oct 28, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the docs/223-after-capture-redraw branch October 28, 2026 22:21
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.

desktop: input after-captures can precede the app's redraw

1 participant