Skip to content

fix(channels): reject whitespace-only agentId with 400 - #358

Merged
davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:fix/activity-whitespace-agentid
Sep 4, 2026
Merged

davidmckayv merged 2 commits into
CopilotKit:mainfrom
Ayush7614:fix/activity-whitespace-agentid

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

parseActivityInput accepted " " as a valid agentId, trimmed it to "", then recordActivity treated it as a lookup and returned 404 Agent not found. A malformed field should be a 400 naming the field, consistent with the existing text validation.

Repro: POST /api/channels/:id/activity with {"text":"hi","agentId":" ","at":now} -> 404 before, 400 after.

Tests: added whitespace-only case to server/tests/channel-activity-input.test.ts (5 pass). Biome format+lint clean.

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

Reviewed diff against current main; resolved CHANGELOG keep-both; validated locally (format + composed test run). CI green.

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