Description
A V2 session using a custom OpenAI-compatible model reached about 236k of its 299,964-token context window (79%). Automatic compaction did not run, and /compact failed because the provider reported that the prompt plus requested output exceeded the context limit.
The model advertises a 131,072-token output limit. SessionCompaction.required() caps its reserved output budget at 32,000, but the compaction LLM.request() does not set generation.maxTokens. OpenAI-compatible lowering therefore leaves max_tokens unset, allowing the provider to use 131,072 instead.
Expected: the compaction request should use the same bounded output budget used to calculate the automatic-compaction threshold.
Before /compact, the model also returned finish=stop with no text or tool calls several times, leaving the TUI with no visible response. This may be a separate empty-response issue.
Plugins
No response
OpenCode version
0.0.0-next-17403
Steps to reproduce
- Configure a custom OpenAI-compatible model with context limit 299964 and output limit 131072.
- Grow a V2 session to approximately 236k tokens, displayed as 79% context usage.
- Observe that automatic compaction does not run.
- Run
/compact.
- Observe that the provider rejects the request because the prompt plus requested output exceeds the context window.
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
Description
A V2 session using a custom OpenAI-compatible model reached about 236k of its 299,964-token context window (79%). Automatic compaction did not run, and
/compactfailed because the provider reported that the prompt plus requested output exceeded the context limit.The model advertises a 131,072-token output limit.
SessionCompaction.required()caps its reserved output budget at 32,000, but the compactionLLM.request()does not setgeneration.maxTokens. OpenAI-compatible lowering therefore leavesmax_tokensunset, allowing the provider to use 131,072 instead.Expected: the compaction request should use the same bounded output budget used to calculate the automatic-compaction threshold.
Before
/compact, the model also returnedfinish=stopwith no text or tool calls several times, leaving the TUI with no visible response. This may be a separate empty-response issue.Plugins
No response
OpenCode version
0.0.0-next-17403
Steps to reproduce
/compact.Screenshot and/or share link
No response
Operating System
No response
Terminal
No response