Skip to content

Shape human click, type and key payloads on POST /api/computers/:botId/human/:kind with 400 - #517

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/computer-human-input-validation
Open

Shape human click, type and key payloads on POST /api/computers/:botId/human/:kind with 400#517
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/computer-human-input-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

Only scroll was checked on the takeover route. A click with {x:"ten"}, a type with {text:123} or a key with {} travelled to the computer untouched, surfacing as its 500 or a 200 no-op. The shapes are the ones the gateway HumanInput type already promises: click carries finite x/y viewport pixels, type carries string text, key carries a non-empty name. Scroll keeps its existing check.

Updates the old kind-override test to carry text so it still exercises the kind-wins guard under the new shape rule.

Tests: new server/tests/computer-human-input.test.ts (19 cases: happy paths, 7 malformed clicks, 4 types, 4 keys, scroll default) — 40 pass with routes + scroll-delta suites.

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