Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

クローズ 初心者向け
#55,392 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
70/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
typescript
領域
api

調査の方向性

不具合は toModelMessagesEffect にあります。アシスタントのテキストパートは空文字列かどうかの確認なしに追加されています。issue はユーザーパートのフィルター(part2.text !== "")と同じものを適用することを提案しています。この関数がアシスタントの内容をどのように組み立てるか、hasSignedReasoning による " " への置換を含めて読み、空のテキストが AI SDK の output_text 変換のどこに届くかを確認してください。空のアシスタントのテキストパートを履歴から除き、それ以外の動作を変えなければ完了です。指示書にはテストファイル名がないため、この変換に既存のテストがないか探してください。

索引モデルが issue の本文から書いたものです。

説明

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

主要言語
TypeScript
スター
213k
フォーク
28.4k
平均マージ
8時間 58分
マージ済み PR(30日)
251

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

anomalyco/opencode のほかの issue

anomalyco/opencode の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。