Support Enter submission for editable fields

RO
5d ago
+131-16

Chat inputs that submit on Enter can be filled, but the agent cannot send the message when there is no send button.

Add PRESS_ENTER with an operation-specific target head for observed editable fields. The executor resolves and focuses the referenced node, then sends Enter keyDown/keyUp through the existing cdp(...) path, including carriage-return text on keyDown. A host app that wraps cdp sees every key event.

The action retains freshness, visibility, occlusion, and read-only checks. It uses no generated text, arbitrary keys, selectors, or new dependencies. The policy instructions and README action list are updated.

Validation:

  • tests/test_agent.py: 38 passed, covering target-head selection, invalid targets, stale pages, CDP events, no text-helper call, execution logging, and no mutation retry.
  • scripts/check_guards.py against a headless Chrome: 24 checks pass, including the new native-form submission, chat-input submission and read-only Enter checks. No model calls.
  • Ruff, node --check on both JavaScript files, and the sdist and wheel builds pass.

🤖 Generated with Claude Code


Summary by cubic

Adds a PRESS_ENTER operation so agents can submit chat inputs and forms that have no send button via the keyboard. The executor resolves an observed editable field, focuses it, and sends Enter keyDown/keyUp through the existing CDP path, so host apps wrapping cdp see every key event.

  • Targets editable fields only and keeps freshness, visibility, occlusion, and read-only checks.
  • Requires no generated text, selectors, or new dependencies.
  • Updates the README, policy instructions, and guard scripts.