anomalyco / anomalyco/opencode

Automatic Compaction Triggers at 50% of Context Window

Open
#39,798 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 31, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Automatic Compaction Triggers at 50% of Context Window, when a single prompt instructs model to read a few long .md markdown files, upon reaching approximately half of the context window, automatic compaction is triggered. Reproducible with same instructions in new session. This problem only seems to have appeared after recent updates.
(context window of provider model is 1m but triggers compaction at around 500k, but config buffer is set ass only 10k)
(provider is nvidia nim deepseek v4 pro routed behind a proxy)

Plugins

oh-my-openagent

OpenCode version

1.18.8

Steps to reproduce
  1. Install opencode 1.18.8
  2. Prepare a few long markdown files
  3. Instruct model to read all of them in full without truncation +/- other instructions
  4. Compaction triggers around 50% of context window usage
Screenshot and/or share link

No response

Operating System

debian

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.