Skip to content

[BUG] /compact command does not compress - context increases instead #17557

@guyinwonder168

Description

@guyinwonder168

Description

The /compact command does not actually compress the context. Instead, the context token count increases after running /compact, indicating the command either fails silently or does nothing at all.

Evidence

Before /compact:

  • Context: 50,241 tokens (25%)

After /compact:

  • Context: 51,405 tokens (25%)
  • Change: +1,164 tokens (context INCREASED)

No visual feedback was shown in the TUI during compaction (no "compacting" status), and no compression actually occurred.

Related Issues

This appears to be related to or a more severe version of:

Steps to Reproduce

  1. Start a session with moderate context (25%+ used)
  2. Note the current token count (e.g., via TUI status or /compact prompt)
  3. Run /compact
  4. Check token count again
  5. Observe that context has NOT decreased (may even increase)

Expected Behavior

  • Context tokens should DECREASE after /compact
  • TUI should show a "compacting" status during operation
  • Compression should actually occur

Actual Behavior

  • Context tokens INCREASED (+1,164 tokens)
  • No TUI feedback during compaction
  • No compression occurred

Environment

  • OpenCode version: (latest - please specify in comments)
  • OS: Linux
  • Model: GLM-5 (zai-coding-plan/glm-5)

Additional Context

This was tested in a session with:

  • ~80 messages exchanged
  • 1 manually compressed block (via compress tool)
  • Git operations, file reads/writes, and GitHub searches performed

The manual compress tool (agent-side compression) works correctly, but the user-facing /compact command does not.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions