Repository navigation
Description
Description
When a session/prompt request fails with a terminal LLM error on a resumed session, the ACP server never answers the request: no PromptResponse, no JSON-RPC error, no session/update explaining the failure. The client waits forever and the user just sees a spinner.
Environment
- kimi-code 0.28.1 (npm
@moonshot-ai/kimi-code), macOS arm64 - Client: helios-kanban ACP harness (
session/load+session/promptper turn, process killed after each turn)
Evidence
-
A long ACP session (84 steps) ended normally from the client's perspective — the final assistant text was streamed and displayed.
-
However, the last step was persisted incompletely in
~/.kimi-code/sessions/<ws>/<session>/agents/main/wire.jsonl: onlystep.beginand a single emptycontent.part({"type":"think","think":""}); no text parts and nostep.end— even thoughlogs/kimi-code.logrecordsllm response turnStep=0/84 ... outputTokens=478. Same torn-record pattern as Empty assistant message after terminal crash causes 400 on session resume (DeepSeek) #1404; here the ACP client terminated the process right after the turn completed, so the final step never got flushed. -
The next day, a follow-up via
session/load+session/prompt.kimi-code.logshows:2026-07-22T01:58:08.961Z INFO session resume app_version=0.28.1 2026-07-22T01:58:11.496Z INFO llm request turnStep=1.1 2026-07-22T01:58:12.255Z WARN llm request failed turnStep=1.1 attempt=1/10 model=k3 errorName=APIStatusError errorMessage="400 the message at position 202 with role 'assistant' must not be empty" statusCode=400(the k3 provider's wording of the Empty assistant message after terminal crash causes 400 on session resume (DeepSeek) #1404 error)
-
After that single WARN: nothing. No further retry attempts, no
llm response, no ACP traffic. The pendingsession/promptrequest was still unanswered 9 minutes later; the process stayed alive but silent.
Expected
A terminal LLM failure must resolve the pending session/prompt request — ideally with a JSON-RPC error response, or at minimum a session/update carrying the error followed by a PromptResponse — so ACP clients can surface the failure instead of hanging indefinitely.
Separately, #1882 will make this specific trigger recoverable by dropping the empty assistant tail on resume; but any other terminal LLM failure would still hang the client, so the protocol-level fix is needed independently.
Related
- Empty assistant message after terminal crash causes 400 on session resume (DeepSeek) #1404 — empty assistant message after interrupted turn causes 400 on resume (root cause of the 400 seen here)
- fix(agent-core): drop empty assistant tail left by an interrupted turn on resume (#1404) #1882 — open fix PR for the resume-side repair
Activity