GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [FEATURE]: Feature Request / Bug: Per-agent compaction control breaks local model workflows · Issue #34510 · anomalyco/opencode

[FEATURE]: Feature Request / Bug: Per-agent compaction control breaks local model workflows #34510

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[FEATURE]: Feature Request / Bug: Per-agent compaction control breaks local model workflows#34510
Copy link
Assignees
nexxeln

Description

@nitdraig
nitdraig
opened on Jun 29, 2026
Issue body actions

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Feature Request / Bug: Per-agent compaction control breaks local model workflows

OpenCode version: 1.17.11
OS: Windows 11


Problem

Auto-compaction cannot be disabled per-agent. The compaction: { "enabled": false } field in agent config is currently ignored — compaction still triggers globally regardless of agent-level settings.

This creates an infinite loop when using local models (LM Studio / Ollama) as agents:

  1. Local model responds and finishes naturally (finish === "stop")
  2. Auto-compaction triggers
  3. OpenCode injects a synthetic "Continue..." message
  4. Local model responds again
  5. Loop repeats indefinitely

This is especially problematic because local models have small context windows (8K–14K tokens). The global system prompt + instructions already consume most of the available context, leaving almost no room before compaction fires.


Current workaround

Setting compaction: { "auto": false } globally disables auto-compaction for all agents, including cloud agents that benefit from it. This is a regression for cloud workflows.


Expected behavior

compaction: { "enabled": false } in an agent config should prevent auto-compaction from triggering for that specific agent session, consistent with how other per-agent overrides already work (model, tools, steps, temperature, permission).


Proposed config

"agent": {
  "coder-local": {
    "model": "lmstudio/qwen/qwen3.5-9b",
    "compaction": { "enabled": false }
  },
  "lexis-one": {
    "model": "opencode-go/kimi-k2.6"
    // compaction uses global default
  }
}

Related issues

  • [FEATURE]: Per-agent compaction config (disable compaction for specific agents) #16375 — Per-agent compaction config (feature request, open)
  • Auto-compaction infinite loop when assistant ended its turn (finish !== tool-calls) #15533 — Auto-compaction infinite loop when finish === "stop" (bug, open)
  • Stuck in compaction loop, no matter what i do it doesn't read AGENTS.md #19410 — Stuck in compaction loop

Why this matters

Local model support is one of OpenCode's key differentiators. Without per-agent compaction control, local models are effectively unusable in multi-turn sessions, which defeats the purpose of having local agent configurations.

Activity

  1. github-actions
    assigned
    nexxeln
    on Jun 29, 2026
  2. github-actions commented on Jun 29, 2026

    @github-actions
    github-actionsBot
    on Jun 29, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Per-agent compaction config (disable compaction for specific agents) #16375: Per-agent compaction config (disable compaction for specific agents) — this is essentially the same feature request
    • Auto-compaction infinite loop when assistant ended its turn (finish !== tool-calls) #15533: Auto-compaction infinite loop when assistant ended its turn — covers the infinite loop bug described here
    • Stuck in compaction loop, no matter what i do it doesn't read AGENTS.md #19410: Stuck in compaction loop — related compaction loop issue

    If these existing issues cover your use case, please consider adding your context there instead.

  3. github-actions commented on Aug 29, 2026

    @github-actions
    github-actionsBot
    on Aug 29, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  4. github-actions
    closed this as not plannedon Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @nexxeln
    nexxeln

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.