You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] 400 "A parameter specified is not valid" with volcengine kimi-k2.7-code on tool-call continuation (regression from 2.7.42) #1570
opencodex 2.12.0 (confirmed still present in 2.13.0)
Provider: volcengine (https://ark.cn-beijing.volces.com/api/coding/v3), model kimi-k2.7-code
Adapter: openai-chat
Problem
Requests carrying assistant tool_calls + tool messages get rejected by the upstream:
Provider error 400: A parameter specified in the request is not valid
Plain conversations work; only tool-call continuation turns fail. This is intermittent from the client's perspective because only requests with tool history trigger it.
Root cause
emptyAssistantContent() in src/adapters/openai-chat.ts (introduced in 2.12.0) returns an empty text ARRAY for Volcengine Ark providers:
When an assistant message has tool_calls but no text, this becomes content: [{type:"text",text:""}]. Volcengine kimi-k2.7-code rejects that shape (strict validator); DeepSeek tolerates it, so only kimi is affected.
2.7.42 used an empty string on the same path, which every Ark model accepts:
if(!chatMsg.content)chatMsg.content="";
Reproduction (direct API call)
POST /api/coding/v3/chat/completions, model kimi-k2.7-code:
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"
Impact
Any session routed to Volcengine kimi-k2.7-code in a tool-calling loop gets 400s. Verified that all other Ark models tested (deepseek-v4-flash, deepseek-v4-pro, doubao-seed-2.1-turbo, glm-5.2, minimax-m3, kimi-k2.6) accept content="".
Suggested fix
Do not emit an empty text array from emptyAssistantContent(). Return "" (as 2.7.42) for all providers, or special-case Ark kimi models.
Workaround (local patch)
Changing emptyAssistantContent to return "" fixes it; verified all 7 tested Ark models return 200.
Note
The noStructuredOutputModels option introduced in 2.13.0 addresses a separate response_format passthrough issue and does not affect this bug.
Duplicate of #1571 — same Volcengine Coding Plan tool-call continuation 400, same reporter, same title. Consolidating the discussion there.
The fix is already on dev via #1574 (9da50d0): the structured empty-assistant placeholder from #796 now applies only to recognized Ark hosts at the exact normalized /api/v3 base path, so Coding Plan (/api/coding/v3) keeps the plain empty string that it accepts.
Closing as a duplicate; #1571 carries the resolution.
Activity
github-actions commentedon Aug 13, 2026
Maintainer decision respected
A maintainer has reopened this issue. The automated closure has been deactivated.
lidge-jun commentedon Aug 13, 2026
Duplicate of #1571 — same Volcengine Coding Plan tool-call continuation 400, same reporter, same title. Consolidating the discussion there.
The fix is already on
devvia #1574 (9da50d0): the structured empty-assistant placeholder from #796 now applies only to recognized Ark hosts at the exact normalized/api/v3base path, so Coding Plan (/api/coding/v3) keeps the plain empty string that it accepts.Closing as a duplicate; #1571 carries the resolution.