Skip to content

Refuse non-string functions on POST /api/components/:name/decision with 400 - #515

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/component-decision-functions-validation
Open

Refuse non-string functions on POST /api/components/:name/decision with 400#515
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/component-decision-functions-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

The route filtered non-string functions out, so {functions:[123,null,{}]} became [] and was answered allowed:true — a fail-open verdict on a governance endpoint. Whitespace Bot ids had the same shape problem one line up (404 instead of 400).

Absent still means none; a present list must be all non-blank strings (400 Functions must be a list of function names.), and the Bot id is trimmed before the presence check. Updates the old test that asserted the ignore-behavior to the corrected 400.

Tests: new server/tests/component-decision-functions.test.ts (18 cases) + updated decision test — 23 pass.

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