[WIP] Fix failing GitHub Actions job JS Tests (shard 4/4)#33165
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
The Anthropic API rejects input_schema objects that use anyOf at the top level. The constraint is already conveyed in the tool description, so the anyOf can be safely removed. Fixes failing test: safe_outputs_mcp_schema_validation.test.cjs > Schema Consistency > should not use oneOf, allOf, or anyOf at the top level of inputSchema (Anthropic API incompatible) Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot format and lint |
Ran |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes a failing test in the JS Tests (shard 4/4) job. The MCP schema validation test enforces that tool inputSchema objects must not use top-level anyOf/oneOf/allOf (Anthropic API incompatible). The update_pull_request tool definition had a top-level anyOf, causing the test to fail. The PR removes that anyOf, relying on the existing handler-level validation (hasUpdatePullRequestFields) and the tool description to enforce the "at least one of title/body/update_branch=true" constraint.
Changes:
- Remove top-level
anyOffrom theupdate_pull_requesttool inputSchema insafe_outputs_tools.json. - Reformat (collapse multi-line to single-line) the
hasUpdatePullRequestFieldshelper insafe_outputs_handlers.cjs. - Reformat several existing assertions in
safe_outputs_handlers.test.cjsto single lines (no behavioral change).
Show a summary per file
| File | Description |
|---|---|
| actions/setup/js/safe_outputs_tools.json | Removes the top-level anyOf constraint from the update_pull_request tool schema to satisfy the Anthropic-API compatibility test; also drops a stray blank line. |
| actions/setup/js/safe_outputs_handlers.cjs | Cosmetic single-line reformat of hasUpdatePullRequestFields; runtime validation behavior unchanged. |
| actions/setup/js/safe_outputs_handlers.test.cjs | Cosmetic reformatting of existing expect(...).toThrow(...) and toHaveBeenCalledWith calls; tests still cover null/undefined args, update_branch: false, and successful update cases. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 3/3 changed files
- Comments generated: 0
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress.