Skip to content

[Bug]: Kimi K3 rejects post-compression history — orphaned tool messages ("need a resolvable tool name") #661

Closed

Description

@Wedronix

Summary

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.

Environment

  • opencode version: 2.0.32
  • OS: Linux 7.0.0-31-generic x86_64 (Ubuntu)
  • Terminal: tmux (TERM=xterm-256color, COLORTERM=truecolor)
  • Shell: /bin/bash
  • Install/channel: latest
  • Active plugins: @tarquinen/opencode-dcp@latest
  • Model: moonshotai/kimi-k3 (OpenRouter)

Reproduction

  1. Run OpenCode v2.0.32 with @tarquinen/opencode-dcp@latest and model moonshotai/kimi-k3.
  2. 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).
  3. 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

Activity

  1. Tarquinen commented on Nov 16, 2026

    @Tarquinen
    Owner

    Fixed in #683 (merged into dev). It will ship in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions