Skip to content

fix: reject wait options without a matching mode - #606

Open
pqminh27 wants to merge 2 commits into
vercel-labs:mainfrom
pqminh27:codex/d2-wait-option-validation
Open

pqminh27 wants to merge 2 commits into
vercel-labs:mainfrom
pqminh27:codex/d2-wait-option-validation

Conversation

@pqminh27

@pqminh27 pqminh27 commented Nov 7, 2026 •

Copy link
Copy Markdown

Summary

Reject wait --action unless the wait has an element mode and --predicate actionable, and reject wait --window-id unless it has an event mode that supports window identity. Validate these combinations before desktop observation and report INVALID_ARGS consistently through the CLI, MCP, batch, and FFI entry points. Update the command and skill documentation with these constraints.

Related issues

Fixes #605

Type of change

  • fix: — bug fix
  • feat: — new feature
  • docs: — documentation only
  • refactor: — no behavior change
  • perf: — performance improvement
  • test: — adding or fixing tests
  • chore: — maintenance / dependencies
  • ci: — CI/CD changes
  • BREAKING CHANGE — incompatible ABI or CLI change

How tested

  • cargo fmt --all -- --check
  • cargo clippy --locked -p agent-desktop-core -p agent-desktop-macos -p agent-desktop -p agent-desktop-ffi --all-targets -- -D warnings (Rust 1.89)
  • cargo test --locked -p agent-desktop-core -p agent-desktop-macos -p agent-desktop -p agent-desktop-ffi --lib
  • cargo test --locked -p agent-desktop
  • cargo test --locked -p agent-desktop-ffi --tests
  • cargo tree -p agent-desktop-core
  • AGENT_DESKTOP_E2E_EXCLUSIVE=1 bash tests/e2e/run.sh (macOS 27.0.1, Xcode 27.2; 135 passed, 5 failed, 2 skipped)

The full E2E run reported these failures:

  • Three stale-ref assertions (removed target, direct write, and batch write) returned APP_UNRESPONSIVE instead of STALE_REF; delivery was not performed.
  • The actionable-wait assertion failed. The following click succeeded and advanced the fixture count from click-2 to click-3.
  • The Control Center click did not return a panel snapshot containing a Sound button.

Two scenarios were skipped because their setup conditions were unavailable: the denied Automation TCC case (Accessibility permission was already granted) and Dock launch (no stopped TextEdit, Calculator, or Notes item was pinned in the Dock). The baseline run did not reach these same scenarios, so I have not classified these failures as pre-existing.

The focused live CLI test wait_orphan_options_return_invalid_args passed with Accessibility permission.

Checklist

  • PR title uses a conventional-commit prefix (type: description, lowercase, no capital after colon)
  • cargo fmt and cargo clippy -D warnings are clean
  • All tests pass
  • No unwrap() added in non-test code
  • No inline comments added (only /// doc-comments on public items)
  • All modified files are within the 400 LOC limit
  • Skill docs updated for the wait option contract
  • README / other docs updated for the public behavior

@vercel

vercel Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

@pqminh27 is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@pqminh27
pqminh27 force-pushed the codex/d2-wait-option-validation branch from 9fd2d99 to 2619e2b Compare November 7, 2026 20:36
@pqminh27
pqminh27 force-pushed the codex/d2-wait-option-validation branch from 2619e2b to 5d76138 Compare November 16, 2026 04:13
@pqminh27

Copy link
Copy Markdown
Author

@ctate, could you take a look? The Actions runs are waiting for approval.

@pqminh27
pqminh27 force-pushed the codex/d2-wait-option-validation branch from 5d76138 to bfbf89c Compare November 19, 2026 07:23

This branch has not been deployed

No deployments
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.

[Bug]: reject wait action and window-id options without their required mode

1 participant