You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
System prompt 'continue or ask' text hardcoded — causes autonomous resource-heavy actions #32634
The system prompt appended during compaction contains this hardcoded instruction:
"Continue if you have next steps, or stop and ask for clarification if you are unsure how to proceed."
(packages/opencode/src/session/compaction.ts line 507)
The wording prioritizes continuing by default — "Continue if... or stop..." — which causes the agent to proceed autonomously with resource-heavy actions (starting servers, launching multi-GB model inference, processing large batches) rather than asking the user first.
Incident
In our usage, this default-to-continue behavior cascaded into multiple system OOM crashes:
Agent launched an ONNX embedding server with int8 model (autonomously)
Server had a memory leak (ONNX Runtime CPU arena + glibc malloc not releasing memory) → 15+ GB RSS
Agent attempted three more "fixes" autonomously (concurrency lock, memory arena disable, worker count reduction), each re-launching and crashing the system again
Machine required hard reset
Each step was autonomously executed because the prompt says "continue if you have next steps" — and launching a process counted as "having next steps."
Proposed Fix
Two options:
A) Flip the priority (minimal change, same file):
"Stop and ask for clarification if you are unsure how to proceed, otherwise continue if you have next steps."
This small rewording makes asking the default and proceeding the exception, which is safer for operations that consume significant system resources.
B) Make the text configurable via instructions or a dedicated config field (larger change):
Allow projects to override the compaction system prompt suffix through opencode.json instructions field. If the config already supports instructions for appending to the system prompt, the compaction suffix should also respect these — or be overridable with a dedicated field.
File Location
packages/opencode/src/session/compaction.ts line 507
Test reference: packages/opencode/test/session/compaction.test.ts
This issue might be a duplicate of or closely related to existing issues. Please check:
/compact causes the agent to continue unexpectedly #18794: Describes the same root cause — the compaction prompt's default-to-continue behavior causes the agent to proceed when it should wait for user input. That issue also proposes that 'continue working is not always the correct default after compaction.'
If these don't fully cover your report (especially the specific hardcoded string and the OOM cascade incident), it may still be worth keeping open as a distinct issue with the concrete fix proposals and file reference.
Ive seen similar issues marked as duplicate and closed. I dont understand why this is being ignored. I am running a local model so it costs me nothing, but it is constantly running into infinite loops. One time it was ready to finish and respond but it ran out of context, then it did a long compacting task, and the system injected the continue text which the model mistakenly interpreted to mean I want it to continue with development.It was going for 75 minutes before I realized what was happening.
An instruction like this should not be hard coded in the system. ganzuul's suggestion would very likely help considerably, but its better for the agent to get a system instruction like this from a user editable location. Additionally, the model is unable to distinguish a user request from a system injected prompt. I think it would be better to have a message that is more direct. "<This is a system message> Your context has been compacted; stop and ask for clarification if you have finished your current task."
Personally, I wouldn't tell it to "continue if you have next steps", because I like to start a work session by making a plan of action and then going one step at a time, making commits after each step. Again, this text should be in some config file that is easy to personalize based on a user's workflow preferences. They shouldn't have to actively fight it with their own instructions.
The hardcoded "Continue if you have next steps, or stop and ask for clarification" message is gone in OpenCode v2. Compaction now inserts a checkpoint marked as historical context, not new instructions, and no continuation message is added. The model isn't nudged to keep going on its own after compaction.
Changed in the v2 compaction rewrite.
Closing as completed. If something doesn't work on v2, please open a new issue.
Activity
github-actions commentedon Jun 17, 2026
This issue might be a duplicate of or closely related to existing issues. Please check:
If these don't fully cover your report (especially the specific hardcoded string and the OOM cascade incident), it may still be worth keeping open as a distinct issue with the concrete fix proposals and file reference.
rustysixslinger commentedon Jul 13, 2026
This is a rather big issue.
AStrizh commentedon Sep 3, 2026
Ive seen similar issues marked as duplicate and closed. I dont understand why this is being ignored. I am running a local model so it costs me nothing, but it is constantly running into infinite loops. One time it was ready to finish and respond but it ran out of context, then it did a long compacting task, and the system injected the continue text which the model mistakenly interpreted to mean I want it to continue with development.It was going for 75 minutes before I realized what was happening.
An instruction like this should not be hard coded in the system. ganzuul's suggestion would very likely help considerably, but its better for the agent to get a system instruction like this from a user editable location. Additionally, the model is unable to distinguish a user request from a system injected prompt. I think it would be better to have a message that is more direct.
"<This is a system message> Your context has been compacted; stop and ask for clarification if you have finished your current task."Personally, I wouldn't tell it to "continue if you have next steps", because I like to start a work session by making a plan of action and then going one step at a time, making commits after each step. Again, this text should be in some config file that is easy to personalize based on a user's workflow preferences. They shouldn't have to actively fight it with their own instructions.
neriousy commentedon Oct 1, 2026
The hardcoded "Continue if you have next steps, or stop and ask for clarification" message is gone in OpenCode v2. Compaction now inserts a checkpoint marked as historical context, not new instructions, and no continuation message is added. The model isn't nudged to keep going on its own after compaction.
Changed in the v2 compaction rewrite.
Closing as completed. If something doesn't work on v2, please open a new issue.