Skip to content

fix(mcp): report desktop_type preparation failures as no input sent - #287

Merged
ElbertePlinio merged 2 commits into
mainfrom
fix/267-desktop-type-prep-report
Oct 7, 2026
Merged

ElbertePlinio merged 2 commits into
mainfrom
fix/267-desktop-type-prep-report

Conversation

@ElbertePlinio

Copy link
Copy Markdown
Member

MCP desktop_type now reports a preparation failure as no input sent. Before, any typeText failure with a typed value present was recorded as "input attempted", including preparation failures that guarantee no key was sent.

typingFailure() in packages/desktop-linux/src/x11-wire.ts now returns a new DesktopTextPreparationError, exported from the desktop-linux package. The two other preparation errors in x11-prebind.ts use it too. In typeText, everything before the single xdotool type call is wrapped, so any other error there is re-thrown as the new class with the same message. Dispatch failures still throw the plain "text may have been partially sent" error. In packages/mcp-server/src/tools/desktop.ts, both the no-capture and the capture paths record not-attempted for the new class, using the existing evidence state. The typed value stays out of errors and evidence. The CLI desktop type path writes no input state, so it is unchanged.

Requirement Verified by Scenario Result Evidence
Report a preparation failure as no input sent Automated desktop-input-captures.test.ts: desktop_type with and without capture, preparation failure versus input failure; fails with the MCP change removed Pass Changed tests
Report a preparation failure as no input sent QA pass (real MCP server over stdio, real desktop session) 65,537-character text, which fails preparation, with capture: "after" and without capture Result inputState: "not-attempted", error "input failed; input not-attempted. Input is never retried automatically" (capture) and "Desktop text preparation failed; no text was sent" (no capture); evidence records two not-attempted ~/Artifacts/pickforge-batch-2026-10-07/qa-267/ (local)
A failure after sending still reports attempted Automated Dispatch-loss cases assert a plain Error, not the new class; MCP input failure gives attempted Pass Changed tests
Happy path unchanged QA pass desktop_exec zenity --entry, then desktop_type "hello qa267" with capture inputState: "completed"; screenshot shows only hello qa267 in the entry, nothing from the failed input QA screenshot
Typed value never exposed Automated and QA pass Tests assert the value is absent; QA output and actions.jsonl contain none of the 65,537-character input Pass QA evidence
No regressions Automated bun run lint, bun run typecheck, bun run build; GSK_RENDERER=cairo bun run test:coverage at 9ab733a: 2905 passed, 6 skipped, thresholds held (87.92 / 82.86 / 88.30 / 88.88); PickCheck no new or worsened violations Pass Lead run

Follow-up filed: #284 (a refused agent permit is still recorded as attempted).

Closes #267

Preparation failures in typeText now throw DesktopTextPreparationError,
exported from @pickforge/lab-desktop-linux. MCP desktop_type records
inputState not-attempted for them, with and without capture. Dispatch
failures still report input attempted.

Closes #267
@ElbertePlinio
ElbertePlinio merged commit dfce400 into main Oct 7, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/267-desktop-type-prep-report branch October 7, 2026 21:46
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.

mcp: desktop_type reports 'input attempted' when preparation sent no text

1 participant