Repository navigation
feat(mcp)!: take UI targets as top-level ref, selector, and x/y - #4459
Conversation
An agent without the schema loaded guesses the CLI's vocabulary as flat
arguments, such as press {"ref":"@e6"} or click {"selector":"id=..."}.
The interaction tools wanted {"target":{"kind":"ref","ref":"@e6"}}, so
each guess cost an INVALID_ARGS turn.
The shared command input in command-surface is now flat: press, click,
fill, longpress, and hover take ref (with optional label), selector, or
x with y as top-level keys; get takes ref or selector. The CLI readers
spread the positional parser's target into that same object, the MCP
schema stays derived from the field metadata, and kind is gone: the
present key decides the form. The nested target is retired and answers
with the top-level spelling. Batch steps carry the same input, which now
matches the client-api statement that step input uses the client
command's fields. A parity test pins CLI argv and MCP input to the
identical object reaching runCommand for every targeted command.
An argument a tool does not take now answers with a call example the
tool accepts, derived from its required properties plus a declared
example where a placeholder cannot state one (the UI target, fold,
telephony, gesture, batch). A batch step answers with a step example.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Size Report
Startup median (7 runs, lower is better):
|
…at target Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 40 files
Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.
View guided diff | Turn on auto-fix | Re-trigger cubic
- The nested-admission fixtures used `tap`, which batch does not resolve, so they checked nothing; they now use the registered `press`. - The batch retry example names `snapshot` only when that batch's allowlist includes it. - Target field descriptions state "exactly one of ref, selector, or x+y"; the reader's refusals of no target, two targets, and a lone x are pinned with their example hint. The schema keeps no top-level oneOf, which some model clients reject in a tool input schema. - The MCP help preamble and batch help name label in the mapping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The batch doc examples drop the redundant wait kind, so no step reads
like the removed target discriminator.
- A top-level kind is retired beside target: it answers with the same
migration INVALID_ARGS instead of being dropped.
- The target read tests assert the exact projection.
- The help preamble shows MCP calls (press {ref, settle: true}) instead
of CLI flag spellings; batch help says "for example" for its field
list; a test comment names the keys help leaves out.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 7 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: No findings. Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment |
|
This PR is ready at 3038008. CI is green: 22 checks, none failing. There are no conflicts, and nothing else needs to happen before merge. I did not run the tests locally, and I could not verify the live |
Summary
An agent without the schema loaded guesses the CLI's vocabulary, such as
press {"ref":"@e6"}. The interaction tools wanted{"target":{"kind":"ref","ref":"@e6"}}, so every guess cost anINVALID_ARGSturn.command-surfaceis now flat.press,click,fill,longpress, andhovertakeref(with optionallabel),selector, orx+y.gettakesreforselector.kindis gone: the key that is present decides the form.targetnow fails with the top-level spelling.batch --stepsfiles andclient.batch.runsteps that use the nestedtargetnow fail with that migration message. The typedclient.interactions.*API was already flat and is unchanged.client-api.mdalready said step input uses the client command's fields.Hint: Example call: press {"ref":"@e12"}. Inside a batch, it answers with an example step.Validation
command-tools-parity.test.ts, CLI argv and MCP input reachrunCommandas the identical object, for 6 commands across ref, ref with label, selector, point, and pinned ref.claude -pwith only the localagent-device mcp, iPhone 17 Pro Max simulator, Settings app.press {"ref":"@e6"}andclick {"selector":"label=\"Accessibility\""}both landed. 0INVALID_ARGS, both with schemas loaded and with ToolSearch blocked.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.