Empty text parts in history break Responses API providers (missing input.content.text)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 70/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- api
Hướng nghiên cứu
Lỗi nằm ở toModelMessagesEffect, nơi các phần văn bản của assistant được thêm vào mà không kiểm tra chuỗi rỗng; issue đề xuất áp dụng lại bộ lọc của phần người dùng (part2.text !== ""). Hãy đọc cách hàm này dựng nội dung của assistant, bao gồm việc thay bằng " " khi hasSignedReasoning, rồi xác nhận văn bản rỗng đi đến đâu trong bước chuyển đổi output_text của AI SDK. Hoàn thành khi các phần văn bản rỗng của assistant bị loại khỏi lịch sử và phần hành vi còn lại không đổi. Yêu cầu không nêu tên tệp kiểm thử nào, nên hãy tìm các kiểm thử hiện có cho phép chuyển đổi này.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 213k
- Fork
- 28.4k
- Merge trung bình
- 8 giờ 58 phút
- Pull request đã merge (30 ngày)
- 251
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của anomalyco/opencode
-
reproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anomalyco/opencode#56038 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
anomalyco/opencode#56002 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
app: keybinds match the produced character, so Ctrl+F and other letter shortcuts fail on non-Latin layoutsCó thể đã có người làm @ZXLyyds100 đã nhận 1 ngày trước. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
anomalyco/opencode#55676 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui: NumPad End/Home ignored under kitty keyboard protocol (Windows Terminal reports KP_END 57424)Có thể đã có người làm @argszero đã nhận 1 ngày trước. Đang mởreproduced
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anomalyco/opencode#55533 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
anomalyco/opencode#55383 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của anomalyco/opencode
Issue tương tự
-
`cf complete zsh >> .zshrc` fails on vanilla zshCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cloudflare/cf#340 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Rename Madson cameraĐang mở
Độ khó 2/5 Dưới một giờ Mức phù hợp với người mới 75/100
StoDevX/AAO-React-Native#8785 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Broken links in the docsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commitCó thể đã có người làm @myOmikron đã nhận hôm nay. Đang mởbug ready-for-agent
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100