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
[FEATURE]: Notify subagents when their context are running out #53030
This can, for example, notify subagent when a threshold of their context window usage passed a threshold (e.g. 40% or 70%), and telling them to "wrap up and report, your context window is running low". This avoids small models doing too much work and starts to hallucinate / create gibberish.
I searched "context subagent remind OR context subagent notify" without finding any relevant issues.
Thanks for the follow-up to #53024! You're asking for OpenCode to warn a subagent automatically when its context usage passes a set threshold (for example 40% or 70%), telling it to wrap up and report back, so smaller models don't keep going until they start making things up.
In the meantime, this could possibly be done as a v2 plugin, though I haven't built or tested one. The session context hook can add an instruction before each model request, and a plugin can tell when it is in a subagent session (one with a parent). It would need to compare the session's latest token usage against the model's context limit.
Activity
github-actions commentedon Oct 3, 2026
This issue might be a duplicate of existing issues. Please check:
opencodejr commentedon Oct 27, 2026
Thanks for the follow-up to #53024! You're asking for OpenCode to warn a subagent automatically when its context usage passes a set threshold (for example 40% or 70%), telling it to wrap up and report back, so smaller models don't keep going until they start making things up.
Maintainers will consider it. Related issues:
In the meantime, this could possibly be done as a v2 plugin, though I haven't built or tested one. The session
contexthook can add an instruction before each model request, and a plugin can tell when it is in a subagent session (one with a parent). It would need to compare the session's latest token usage against the model's context limit.