Repository navigation
fix(mcp): report desktop_type preparation failures as no input sent - #287
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MCP
desktop_typenow reports a preparation failure as no input sent. Before, anytypeTextfailure with a typed value present was recorded as "input attempted", including preparation failures that guarantee no key was sent.typingFailure()inpackages/desktop-linux/src/x11-wire.tsnow returns a newDesktopTextPreparationError, exported from the desktop-linux package. The two other preparation errors inx11-prebind.tsuse it too. IntypeText, everything before the singlexdotool typecall 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. Inpackages/mcp-server/src/tools/desktop.ts, both the no-capture and the capture paths recordnot-attemptedfor the new class, using the existing evidence state. The typed value stays out of errors and evidence. The CLIdesktop typepath writes no input state, so it is unchanged.desktop-input-captures.test.ts:desktop_typewith and without capture, preparation failure versus input failure; fails with the MCP change removedcapture: "after"and without captureinputState: "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 twonot-attempted~/Artifacts/pickforge-batch-2026-10-07/qa-267/(local)Error, not the new class; MCP input failure givesattempteddesktop_exec zenity --entry, thendesktop_type "hello qa267"with captureinputState: "completed"; screenshot shows onlyhello qa267in the entry, nothing from the failed inputactions.jsonlcontain none of the 65,537-character inputbun run lint,bun run typecheck,bun run build;GSK_RENDERER=cairo bun run test:coverageat 9ab733a: 2905 passed, 6 skipped, thresholds held (87.92 / 82.86 / 88.30 / 88.88); PickCheck no new or worsened violationsFollow-up filed: #284 (a refused agent permit is still recorded as
attempted).Closes #267