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]: Auto-route to RLM when context overflows #9427
When a conversation exceeds the model's context window, OpenCode currently fails with an error or enters an infinite compaction loop. This blocks users from continuing long conversations.
Proposed Solution
Automatically route to RLM (Recursive Language Model) when context overflow is detected. RLM can handle arbitrarily large context by using a Python REPL to analyze the conversation history and generate appropriate responses.
Implementation
When the LLM returns a "prompt is too long" error:
Detect context overflow in processor.ts
Return "rlm" result to the prompt loop
SessionRlm.process() invokes the RLM tool with the full conversation context
RLM uses GLM 4.7 (cheaper model) for subcalls by default
Activity
github-actions commentedon Jan 19, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if your specific case involves additional requirements.
github-actions commentedon Mar 26, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.