Skip to content

_noop tool injection causes empty compaction summaries on LiteLLM proxies #18053

@ufo009e

Description

@ufo009e

Description

When using a LiteLLM-based provider, the compaction agent produces an empty summary (calls _noop instead of generating text), causing complete post-compaction amnesia. The agent loses all knowledge of the conversation after compaction.

The compaction agent (packages/opencode/src/session/compaction.ts) passes tools: {} (empty) to processor.process(). When the conversation history contains any tool calls (e.g., a bash or read call from earlier), all three conditions are met, and _noop gets injected into the compaction request.

The model then calls _noop instead of generating the summary text. The resulting compaction message has summary: true but contains only step-start + tool (_noop) + step-finish parts — no text part with the actual summary.

Plugins

No response

OpenCode version

No response

Steps to reproduce

Reproduction Steps

  1. Start opencode with a LiteLLM-based provider
  2. Have a conversation that involves tool calls (e.g., "list files in this directory")
  3. Trigger compaction (manual via /compact or automatic via context overflow)
  4. Ask the agent what it was previously working on

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions