Empty text parts in history break Responses API providers (missing input.content.text)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- api
Research direction
The bug is in toModelMessagesEffect, where assistant text parts are pushed without an empty-string check; the issue suggests mirroring the user-part filter (part2.text !== ""). Read how that function builds assistant content, including the hasSignedReasoning " " replacement, and confirm where empty text reaches the AI SDK's output_text conversion. Done when empty assistant text parts are dropped from history while other behavior is unchanged; the payload names no test file, so look for existing tests of this conversion.
Written by the indexing model from the issue text.
Description
Description
When building the request for OpenAI-Responses-compatible providers (e.g. Volcengine Ark plan endpoint https://ark.cn-beijing.volces.com/api/plan/v3 configured via @ai-sdk/openai + custom baseURL), assistant messages in session history that contain an empty-string text part ("text": "") are sent as {"type":"output_text","text":""}. Ark strictly validates this and rejects the whole request with:
MissingParameter: The request failed because it is missing input.content.text parameter. (HTTP 400)
Once one such empty text part exists in the session history (produced by earlier turns of other models that tolerate empty text, e.g. via the Anthropic-compatible endpoint), every subsequent request on that session fails permanently - the session becomes unusable, including when switching to any other Responses-API model.
Verified by calling the Ark API directly:
- [{"role":"assistant","content":[{"type":"output_text","text":""}]},{"role":"user",...}] -> 400 MissingParameter input.content.text
- same request with non-empty text -> 200
Root cause in desktop code (v1.18.25, app.asar): in toModelMessagesEffect, assistant text parts are pushed unconditionally, only replaced with " " when hasSignedReasoning; empty text then flows through the AI SDK into output_text with text: "".
Suggested fix: drop assistant text parts whose text === "" when converting history to model messages (user messages already do this: part2.text !== "" is filtered for user parts).
Request IDs from failing calls: 021791626449725a494df944a230ff836cdfb3920056d77a998d5, 021791626336303d5d07458a5ab4d80457611556e9a6a102788ed
Plugins
none
OpenCode version
1.18.25 (OpenCode Desktop)
Steps to reproduce
- Configure a custom provider using the Responses API:
"volcengine-plan": { "npm": "@ai-sdk/openai", "options": { "baseURL": "https://ark.cn-beijing.volces.com/api/plan/v3", "apiKey": "..." } } - In a session, get at least one assistant turn with an empty text part in history (e.g. produced by another provider/model that emits an empty text block, or a streaming artifact)
- Send any message with the Responses-API model -> request fails with "missing input.content.text", every retry fails, session is stuck
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
No response
- Dominant language
- TypeScript
- Stars
- 213k
- Forks
- 28.4k
- Avg merge
- 8h 32m
- Merged PRs (30d)
- 253
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from anomalyco/opencode
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
anomalyco/opencode#55676 · 1 comment ·
Maintainers usually reply within 1 day
-
tui: NumPad End/Home ignored under kitty keyboard protocol (Windows Terminal reports KP_END 57424)Possibly taken @argszero claimed this today. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
anomalyco/opencode#55533 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
anomalyco/opencode#55383 · 3 comments ·
Maintainers usually reply within 1 day
-
web: second Firefox tab never connects to /api/event - Cache-Control: no-cache lets Firefox's HTTP cache block concurrent SSE requestsPossibly taken @zonemeen claimed this 1 day ago. Openreproduced
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
anomalyco/opencode#55369 · 2 comments ·
Maintainers usually reply within 1 day
-
reproduced
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
anomalyco/opencode#55351 · 1 comment ·
Maintainers usually reply within 1 day
All issues in anomalyco/opencode
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
juice-shop/juice-shop#3686 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
dsh-market/dsh-market#877 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ScottKirvan/GOMAC#61 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
stellar/stellar-dev-skill#151 ·
Maintainers usually reply within 1 day