Skip to content

fix(runtime): normalize optional tool schemas - #453

Open
Fxde42 wants to merge 1 commit into
mainfrom
fix/kimi-tool-schema-required
Open

fix(runtime): normalize optional tool schemas#453
Fxde42 wants to merge 1 commit into
mainfrom
fix/kimi-tool-schema-required

Conversation

@Fxde42

@Fxde42 Fxde42 commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • normalize object tool schemas at the final OpenAI Chat Completions provider boundary
  • cover built-in, custom, MCP, and active extension tools after Pi combines them
  • preserve existing required arrays and leave other provider APIs unchanged
  • add unit coverage and an end-to-end Kimi-compatible contract regression test

Closes #452

Testing

  • BP_MOCK=1 npm test -w @brainpilot/runtime — 573 passed
  • npm run typecheck
  • BP_MOCK=1 npx vitest run packages/runtime/src/__tests__/tool-schema-compat.test.ts packages/runtime/src/__tests__/openai-tool-schema-compat.test.ts — 7 passed

AI assistance

This PR was implemented and self-reviewed with AI assistance.

Normalize object schemas at the final OpenAI Completions payload boundary because pi-ai passes omitted required fields through and Kimi intermittently rejects them.
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.

[Bug]: Kimi intermittently rejects all-optional tool schemas across multiple agents

1 participant