Skip to content

[Bug] 400 "A parameter specified is not valid" with volcengine kimi-k2.7-code on tool-call continuation (regression from 2.7.42) #1571

Description

@CarverZheng

Client or integration

Codex App

Area

Provider adapter

Summary

Requests carrying assistant tool_calls + tool messages routed to Volcengine kimi-k2.7-code are rejected by the upstream with 400: A parameter specified is not valid. Plain conversations work; only tool-call continuation turns fail.

Reproduction

POST https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions, model kimi-k2.7-code, with these assistant messages followed by a matching tool message:

assistant message result
content=null + tool_calls 200
content="" + tool_calls 200
content=[{"type":"text","text":""}] + tool_calls 400 "A parameter specified is not valid"

Root cause: emptyAssistantContent() in src/adapters/openai-chat.ts (introduced in 2.12.0) returns an empty text array [{type:"text",text:""}] for Volcengine Ark providers when an assistant message has tool_calls but no text. Volcengine kimi-k2.7-code rejects that shape. 2.7.42 used an empty string "" on the same path, which every Ark model accepts. Verified that deepseek-v4-flash, deepseek-v4-pro, doubao-seed-2.1-turbo, glm-5.2, minimax-m3 and kimi-k2.6 all accept content="".

Version

2.12.0 (confirmed still present in 2.13.0)

Operating system

Windows 10 Home China 10.0.19045

Provider and model

volcengine / kimi-k2.7-code

Logs or error output

Provider error 400: A parameter specified in the request is not valid

Redacted configuration

adapter: openai-chat
baseUrl: https://ark.cn-beijing.volces.com/api/coding/v3
model: kimi-k2.7-code

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingproviderProvider adapters, OpenAI-compat presets, upstream API quirkstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions