Repository navigation
feat(agent): hold modifier keys on tap, double tap, and right click - #957
Merged
Merged
Conversation
zichen0116
requested review from
okwasniewski and
szymonrybczak
as code owners
October 7, 2026 02:23
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 12 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Turn on auto-fix | Re-trigger cubic
…iers - ctx.target.tapModifiers replaces the MCP-only grammar option - executor tap family takes modifiers only, not timeout - trace reader rejects malformed modifiers or modifiers on non-tap verbs - one isTapActionName helper for the tap family - docs + changeset
Contributor
There was a problem hiding this comment.
1 issue found across 14 files (changes from recent commits).
Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack
View guided diff | Re-trigger cubic
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name=".changeset/agent-tap-modifiers.md">
<violation number="1" location=".changeset/agent-tap-modifiers.md:5">
P3: The changeset has a grammatical error in its cache description: change `replay` to `replayed` so it says the held keys are recorded and replayed from the cache.</violation>
</file>
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.
The agent's
tap,double_tap, andright_clicktools take an optionalmodifierslist when the target's engine declarestapModifiers, in bothagent.actand the MCP server. An agent can now Shift-click or Ctrl-click the way the test API'stap({ modifiers })can since #626.ctx.target.tapModifierstells executors whether the target can hold keys for a click. The grammar tools read it, soagent.act, MCP, and custom executors use the same flag. Engines without it get the same schema as before.ctx.actions.tap,doubleTap, andsecondaryTaptake{ modifiers }. Bad values fail withINVALID_ARGUMENT. An engine that doesn't declaretapModifiersrefuses them withUNSUPPORTED_CAPABILITY.tap button "Save" with Shift held) and replayed from the cache. The trace reader rejects an entry whosemodifiersare malformed or sit on a verb that can't hold them.reference/agent.mdx,executors.mdx,reference/mcp.mdx,skills/e2e/references/mcp.md. Changeset:e2epatch.Closes #953
Verified
Ran it locally: yes, on the testbed
/controlspage with a temporary click-log button that recordsevent.shiftKeyand the other modifier flags.MCP, built server, driven with an MCP client:
agent.act('click the "Click log target" button once while holding Shift')withtoHaveText('click[shiftKey]'), live and then from the cache:The recorded entry:
{ "name": "tap", "summary": "tap button \"Click log target\" with Shift held", "modifiers": ["Shift"] }.Unit:
agent-tap-modifiers.test.ts(7 tests, including trace rejection), full e2e unit suite 2663 passed, decision 157 passed.pnpm typecheckandoxlintare clean.