Repository navigation
Interrupted reasoning-only assistant message wedges the session: provider returns 400 "The content field is a required field." #14340
SummaryWhen a streaming turn is cancelled while the model has produced only reasoning (no text block, no tool call), the harness durably appends an On the next turn, Because the message is durable, every later turn fails in <1 s before producing a token, and the session never recovers (retry, reopening, restarting the app all fail). From the user's point of view the conversation is permanently dead. ReproductionA. Harness-level (DSH 0.2.2-rc.5)
{"type":"assistant/message","data":{"interrupted":true,"message":{"role":"assistant","content":[{"type":"reasoning","text":"..."}]}}}
B. Provider-level (independent of DSH) With So the trigger is an assistant message with no Current behavior
Expected behaviorKeep the cancelled prefix durable and visible (as designed), but never send a request that the provider must reject. Either:
// packages/llm/llm-deepseek/src/serialize.ts, next to the existing empty-content skip
if ((message.role === 'user' || message.role === 'assistant') && content.length === 0) continue
if (message.role === 'assistant' && !content.some((b) => b.type === 'text' || b.type === 'tool_use')) continueor
Environment
中文概要流式回答被取消时,如果模型当时只产出了思考(没有正文块、没有工具调用),harness 会按"取消后保留已交付前缀"的既有设计,落一条 下一轮请求会用 这条消息是持久化的,所以之后每一轮都在 1 秒内失败、一个 token 都不产出,会话无法自愈(重试、重开会话、重启 App 都不行),对用户表现为永久卡死。 复现A. Harness 层(0.2.2-rc.5)
B. Provider 层(与 DSH 无关)
即触发条件是"assistant 消息里既没有 text 也没有 tool_use",不是取消本身。 现状代码
期望行为保留已经交付的前缀(设计初衷),但不要发出必然被拒的请求。两种改法:
环境
|
Replies: 1 comment
|
It isn't fixed yet, and I couldn't find anything tracking it. The easiest way to get the conversation back is to branch from the last good turn. Hover the last reply of the turn before the cancelled one and click "Branch into a new conversation". That sends that turn's Changing settings won't get you out. I ran alpha.2's If you'd rather repair the session in place, the log is
On the fix, your spot next to L123 is right. One case worth a test: a completed step can persist the same shape without |
It isn't fixed yet, and I couldn't find anything tracking it.
dsh-v0.2.3-alpha.2is the same commit as current master (4b399c39), and your analysis holds there. Issues and PRs are off on this repo. The closest discussions are #9095 (the same interrupted reasoning prefix on the pi-ai route, replayed as text instead of a 400) and #13184 (a reasoning-only turn wedging a Responses route).The easiest way to get the conversation back is to branch from the last good turn. Hover the last reply of the turn before the cancelled one and click "Branch into a new conversation". That sends that turn's
turn/endseq, and the host copies the log up to and including it into a new session (TurnTailNodeView…