Skip to content

fix(provider): normalize missing array items in tool schemas#21589

Closed
mharris717 wants to merge 1 commit intoanomalyco:devfrom
mharris717:fix-openai-array-items-schema-20260408
Closed

fix(provider): normalize missing array items in tool schemas#21589
mharris717 wants to merge 1 commit intoanomalyco:devfrom
mharris717:fix-openai-array-items-schema-20260408

Conversation

@mharris717
Copy link
Copy Markdown
Contributor

Summary

  • normalize tool schemas so array nodes missing items are converted to items: {} before they are sent to model providers
  • preserve the original permissive schema semantics while avoiding OpenAI/OpenAI-compatible validation failures on MCP tools such as docker_create_container
  • add a regression test for the nested ports -> additionalProperties -> anyOf -> array schema shape that triggered the bug

Testing

  • bun test test/provider/transform.test.ts --timeout 30000
  • push hook: bun turbo typecheck

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Apr 9, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

The following comment was made by an LLM, it may be inaccurate:

I found a potentially related PR:

PR #20775: fix(opencode): sanitize array schemas missing items for all providers
#20775

This PR appears to be directly related to your current PR #21589. Both are addressing the issue of missing items in array schemas. You should check if #20775 already addresses the same problem or if it needs to be updated with your fix.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Apr 9, 2026
@github-actions github-actions bot closed this Apr 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant