Skip to content

Conversation

@edxeth
Copy link
Contributor

@edxeth edxeth commented Jan 24, 2026

Summary

The CLI was sending selector: null and path: null in the JSON payload when these optional fields were not provided. While #236 fixed this on the daemon side by changing Zod validation from .optional() to .nullish(), the CLI should not send null values in the first place.

This is a complementary fix that makes the protocol cleaner:

  • Before: {"action": "screenshot", "path": null, "selector": null, "fullPage": false}
  • After: {"action": "screenshot", "fullPage": false}

Changes

  • Modified cli/src/commands.rs to conditionally include path and selector fields only when they have values

Testing

  • All 123 CLI tests pass
  • Manually tested with CDP connection:
    • agent-browser screenshot (no args) - works
    • agent-browser screenshot /tmp/test.png (with path) - works
    • agent-browser screenshot @e1 (with selector) - works
    • agent-browser screenshot @e1 /tmp/test.png (both) - works

Related to #238

The CLI was sending selector: null and path: null in the JSON payload
when these optional fields were not provided. While the daemon now
accepts null values (via .nullish() in Zod), omitting the fields
entirely is cleaner and aligns with the original schema expectation.

This is a complementary fix to vercel-labs#236 - the daemon accepts null, but
the CLI should not send it in the first place.

Related to vercel-labs#238
@vercel
Copy link
Contributor

vercel bot commented Jan 24, 2026

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

A member of the Team first needs to authorize it.

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.

1 participant