Skip to content

fix(openaiContentGenerator): use parametersJsonSchema fallback for tool declarations#35

Merged
piorpua merged 1 commit intomainfrom
fix/openai-tool-parametersJsonSchema
Mar 26, 2026
Merged

fix(openaiContentGenerator): use parametersJsonSchema fallback for tool declarations#35
piorpua merged 1 commit intomainfrom
fix/openai-tool-parametersJsonSchema

Conversation

@kaizhou-lab
Copy link
Copy Markdown
Collaborator

Summary

  • Fix empty tool call parameters when using OpenAI-compatible models (e.g. gpt-5.4) via newapi protocol
  • Bump version to 0.30.2

Changes

  • openaiContentGenerator.ts: convertGeminiToolsToOpenAI() now falls back to func.parametersJsonSchema when func.parameters is undefined. aioncli-core tool declarations use parametersJsonSchema (from zodToJsonSchema), but the OpenAI conversion only read parameters, producing empty schemas for all tools.
  • package.json: Version bump 0.30.1 → 0.30.2

Root Cause

convertGeminiToolsToOpenAI() reads func.parameters to build OpenAI tool schema, but core tool declarations store the schema in parametersJsonSchema. The empty schema { type: 'object', properties: {} } caused OpenAI-compatible models to strictly return {} for all tool calls.

Test Plan

  • Create a session with newapi protocol and gpt-5.4 model
  • Trigger a tool call (e.g. activate_skill)
  • Verify tool call parameters are correctly populated (not empty {})
  • Verify Gemini-native models still work correctly (they use parameters field)

…ol declarations

Tool declarations in aioncli-core use `parametersJsonSchema` (from zodToJsonSchema)
instead of Gemini-native `parameters`. The OpenAI conversion only read `parameters`,
producing empty schemas `{}` for all tools. OpenAI-compatible models (e.g. gpt-5.4)
strictly follow schema and returned empty tool call arguments.

Fall back to `parametersJsonSchema` when `parameters` is undefined.
Also bump version to 0.30.2.
@piorpua piorpua merged commit 0a1c081 into main Mar 26, 2026
3 of 7 checks passed
@piorpua piorpua deleted the fix/openai-tool-parametersJsonSchema branch March 26, 2026 12:08
kaizhou-lab pushed a commit to iOfficeAI/AionUi that referenced this pull request Mar 26, 2026
Includes fix for empty tool call parameters when using OpenAI-compatible
models via newapi protocol (iOfficeAI/aioncli#35).

Also remove debug logging from gemini/utils.ts.
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.

3 participants