GeezerVison is showing github.com — Feature: Subagents should support auto compaction · Issue #3153 · anomalyco/opencode
Feature: Subagents should support auto compaction #3153DescriptionCurrently, if a subagent goes on a long task and goes over the models context limit, the whole subagent fails.
I think a good solution for this might be auto compaction for sub-agents. If a subagent goes over its context it should reject/remove items that are too big (the last tool/mcp call that sent it over context rejected?) and then auto compact in a way that allows it to continue. This makes subagents resilient and recoverable, because when they go on long tasks and fail it can cost a lot of tokens.
Appreciate all the hard work, opencode is great. Reacted by Muhammad Yasirroni Activitygithub-actions commented on Oct 13, 2025 This issue might be a duplicate or closely related to existing issues. Please check:
While your specific request for auto compaction in subagents is unique, these existing issues address related problems with subagent context management and compaction strategies. You might find useful insights or discussions there.
Feel free to ignore if none of these address your specific case of automatic compaction for subagents hitting context limits. rekram1-node commented on Oct 14, 2025 hmm I thought it would auto compact already will need to check
The auto compact logic isn't fool proof though rekram1-node commented on Oct 14, 2025 ofc and if you ever catch me not replying just @ me haha
yeah that very well could be it, tool overloads context and it cant recover ftom it adpadillar commented on Feb 26, 2026 i am pretty sure this exists (as of at least v1.2.14), i actually came here to open an issue caused by auto-compaction on subagents, but i think this means this can be closed since auto-compaction does work with subagents github-actions commented on Apr 28, 2026 To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one. yasirroni commented on Aug 1, 2026 I'm using a hard-coded context-window limit for the new GPT-5.6. It seems that the subagents keep going.
The setting:
"provider": {
"openai": {
"models": {
"gpt-5.6-terra": {
"limit": {
"context": 229376,
"output": 16384
}
},
"gpt-5.6-luna": {
"limit": {
"context": 229376,
"output": 8192
}
}
},
"options": {
"setCacheKey": true,
"headerTimeout": 60000,
"timeout": 600000,
"chunkTimeout": 60000
}
}
}
The context window:
Subagent(2 of 2)300.7K (131%)
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|