You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Kimi K3 rejects post-compression history — orphaned tool messages ("need a resolvable tool name") #661
After DCP compression runs in a long, tool-heavy session on Kimi K3 (moonshotai/kimi-k3 via OpenRouter), subsequent turns intermittently fail with the provider error Kimi K3 tool messages need a resolvable tool name: carry \tool`/`name`, or match a preceding assistant tool_call by order`. The turn is fully blocked; resending the same user message usually succeeds.
Run OpenCode v2.0.32 with @tarquinen/opencode-dcp@latest and model moonshotai/kimi-k3.
Run a long session with many tool calls (shell/read/edit), so that the agent invokes DCP compress several times. Compressed blocks are created; some retain "protected tools" outputs (the block notes "The following protected tools were used in this conversation as well", e.g. a skill tool result).
Continue working after a compression event.
Observed: 3 failures in a single session, each on a turn following a DCP compression.
Expected Behavior
After compression, the assembled provider history must never contain a tool-role message whose matching assistant tool_call was summarized away (nor an assistant tool_call whose results were removed). Every tool message must resolve by name or by order, as strict chat-template renderers require.
Actual Behavior
The request fails with:
Error: Kimi K3 tool messages need a resolvable tool name: carry `tool`/`name`, or match a preceding assistant tool_call by order
The whole turn is rejected; no partial output is produced.
Additional Context
The error string comes from the Kimi K3 chat-template renderer (e.g. vllmrust/src/chat/src/renderer/kimi_k3/encoding.rs; same string in mlx-vlm, llm-compressor). It strictly validates that every tool message resolves to a tool name.
Hypothesis: when a compressed block retains protected-tool outputs but the assistant message carrying the matching tool_call is replaced by the compression summary, the expanded history contains orphaned tool messages, which Kimi K3 rejects. (A tool_call/tool pair split across a compression boundary would produce the same pattern.)
Activity
Tarquinen commentedon Nov 16, 2026
Fixed in #683 (merged into dev). It will ship in the next release.