Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Empty text parts in history break Responses API providers (missing input.content.text)

Open Beginner friendly
#55,392 1 comment 0 reactions 0 assignees View on GitHub

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

pending close triaging
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
  1. 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": "..." } }
  2. 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)
  3. 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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.