opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Auto-compaction causes the subagent to lose its original context, possibly the system prompt as well

Open gasatrya opened this issue 2 weeks ago • 4 comments

Description

I’m honestly frustrated, this is the second time it has happened.

I have a QA Specialist subagent whose prompt explicitly instructs it to perform only QA-related tasks. However, due to auto-compaction, it loses the original context provided by the main agent. As a result, it suddenly starts reading the planned features document and working on the next phase without my permission.

This is problematic because the subagent was specifically designed to handle QA tasks, not to build or implement new features.

How can I prevent this from happening again in the future?

OpenCode version

1.0.218

Steps to reproduce

Must have main again and subagent.

Screenshot and/or share link

Image Image

Operating System

WSL 2

Terminal

Windows Terminal

gasatrya avatar Dec 31 '25 16:12 gasatrya