Skip to content

feat(computer-use): batch 2-8 actions per call and read app state in one round trip per element - #9995

Merged
waleedlatif1 merged 4 commits into
stagingfrom
feat/computer-use-batch
Nov 13, 2026
Merged

waleedlatif1 merged 4 commits into
stagingfrom
feat/computer-use-batch

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • New batch computer action: 2–8 click / type_text / set_value / press_key / scroll / perform_action steps planned from one snapshot, run in order through each single action's own checks (stale element, window, focus, secure field, occlusion). It stops at the first failing step and after any step that opens or closes a window, sheet, menu or popover, reports sequence.completedSteps, and returns one fresh observation. A first step that sent nothing is refused with dispatchState: not_started, keeping the snapshot valid
  • get_app_state reads each node's attributes in one Accessibility round trip (AXUIElementCopyMultipleAttributeValues) and indexes visited elements by CFHash, removing two O(n²) scans: Finder 341→159 ms, Mail 94→50, Notes 71→39, Calendar 104→61, Safari (2000 nodes) 1382→650 ms; node lists identical (old-vs-old shows the same live-UI noise)
  • Contract synced from mothership (computer-use.generated.ts); Swift Parameters now carries action and nested steps, so input-sequence and batch steps share one shape
  • Benchmark (68 macOS tasks, Opus 5.5, production worker loop): success unchanged vs staging (58/68, p=1.0); on tasks both passed, calls 13.6→12.1, cost $1.17→$1.03, wall 55→48 s; batch used in 45/68 episodes, every early stop by design
  • Companion: simstudioai/mothership#958 (contract + tool description; merge this sim PR first so desktops support batch before the worker offers it — older desktops reject it as not_started and the description tells the model to fall back to single actions)

Type of Change

  • New feature

Testing

  • Native checks (macOS 26) and live fixture test: a batch that applies, stops at a failing step, refuses before dispatch, and stops when a sheet opens
  • desktop computer-use + IPC suites (100), sim mothership client tools + computer-use + settings suites (188), check:test-patterns, check:comment-hygiene; mothership contract parity check

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…bility round trip

Index observed elements by CFHash so membership and parent lookups stay linear,
and query value settability only for text roles.
Each step runs through its single action's checks; the batch stops at the first
failure and after any step that changes the app's window structure, and returns
one fresh observation.
@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 13, 2026 9:04am UTC

Request Review

@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Nov 13, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • ❌ simstudioai/mothership#958 — OPEN, not merged (targets staging) — feat(computer-use): batch 2-8 native actions planned from one snapshot

@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Adds 2–8 computer-use actions per call and reads node attributes together to reduce Accessibility requests.

  • Callers can run several checked actions from one app snapshot.
  • App snapshots read each element's details with fewer Accessibility calls.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  Request[Batch request] --> Validate[Check steps and text limit]
  Validate --> Stop{Stop requested?}
  Stop -->|Yes| Progress[Return completed steps]
  Stop -->|No| Before[Read window identities]
  Before --> Action[Run step through its own checks]
  Action --> Failed{Step failed?}
  Failed -->|Yes| Result[Return refusal or partial result]
  Failed -->|No| Changed{Window structure changed?}
  Changed -->|Yes| Progress
  Changed -->|No, more steps| Stop
  Changed -->|No more steps| Complete[Return completed batch]
Loading

Reviews (2) · Last reviewed commit: "fix(computer-use): stop a batch on menu ..." · Reviewed by Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 7 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

…any step after Stop

The structure guard compares on-screen window and focused-window child identities
instead of counts, and every step checks cancellation first. Synced the contract,
which now bounds batch progress to 2-8 steps.
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

This branch was previously deployed

1 inactive deployment
Preview — d6b81a25 Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant