Skip to content

fix(openai): default empty tool arguments to JSON object - #916

Open
ruirui6946 wants to merge 1 commit into
cloudwego:mainfrom
ruirui6946:codex/default-empty-tool-arguments
Open

fix(openai): default empty tool arguments to JSON object#916
ruirui6946 wants to merge 1 commit into
cloudwego:mainfrom
ruirui6946:codex/default-empty-tool-arguments

Conversation

@ruirui6946

Copy link
Copy Markdown

Summary

  • normalize empty schema tool-call arguments to {} when building OpenAI requests
  • preserve non-empty argument payloads
  • add regression coverage for no-argument tool calls

Why

OpenAI-compatible APIs reject assistant tool calls when the function arguments field is omitted. Streaming no-argument tool calls may be represented as an empty string, so the adapter should emit an empty JSON object.

Fixes cloudwego/eino#493

Validation

  • go test with the Mockey-required no-optimization gcflags from libs/acl/openai

@CLAassistant

CLAassistant commented Jul 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

adk 调用 tool 在参数为空情况下报错

2 participants