Skip to content

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

Merged
davidmckayv merged 4 commits into
CopilotKit:mainfrom
Ayush7614:fix/computer-human-input-validation
Sep 13, 2026
Merged

Shape human click, type and key payloads on POST /api/computers/:botId/human/:kind with 400#517
davidmckayv merged 4 commits 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.

@davidmckayv davidmckayv 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.

Validated: per-gesture human-input validation is correct; rebased on current main (keeps #518), typecheck 0, human-input/computer-routes tests green (31), CI verify green on this sha.

@davidmckayv
davidmckayv merged commit e7bbe77 into CopilotKit:main Sep 13, 2026
15 checks passed
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.

2 participants