Skip to content

fix(ai): reject malformed OpenAI tool calls#5803

Closed
woodgear wants to merge 1 commit into
earendil-works:mainfrom
woodgear:fix/openai-completions-malformed-tool-delta
Closed

fix(ai): reject malformed OpenAI tool calls#5803
woodgear wants to merge 1 commit into
earendil-works:mainfrom
woodgear:fix/openai-completions-malformed-tool-delta

Conversation

@woodgear

Copy link
Copy Markdown

Summary

  • Reject malformed OpenAI-compatible streamed tool calls that finish without an id or function name.
  • Remove malformed tool calls from error results so they cannot be persisted into session history.
  • Add regression coverage for missing tool call id and missing function name.

Testing

  • cd packages/ai && node ../../node_modules/vitest/dist/cli.js --run test/openai-completions-malformed-tool-call.test.ts
  • cd packages/ai && node ../../node_modules/vitest/dist/cli.js --run test/openai-completions-tool-choice.test.ts
  • npm run check

@github-actions

Copy link
Copy Markdown
Contributor

This PR was auto-closed. Only contributors approved with lgtm can open PRs. Open an issue first.

Maintainers review auto-closed issues daily. Issues that do not meet the quality bar in CONTRIBUTING.md will not be reopened or receive a reply.

If a maintainer replies lgtmi, your future issues will stay open. If a maintainer replies lgtm, your future issues and PRs will stay open.

See CONTRIBUTING.md.

@github-actions github-actions Bot closed this Jun 16, 2026
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