Currently, 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.