词元之母TOK.MOM - 平台充值汇率 1:1 即 1 人民币充值到账 1 美元,支持一个 Key 调用近 600+ 海内外模型,限时特价模型低至 1 折,欢迎上岸!

当对话太长时,OpenCode 会自动压缩历史消息,腾出空间继续对话。
/compact 命令的使用时机和效果Error: Request too large for context window 时Context 百分比 = (input + output + reasoning + cache.read + cache.write) / model.limit.context * 100input: 输入给模型的 tokenoutput: 模型输出的 tokenreasoning: 推理模型的思考过程(如 Claude Thinking)cache.read: 从缓存读取的 tokencache.write: 写入缓存的 tokensrc/session/compaction.ts:32-48):input + output + cache.read + cache.writemin(20,000, 模型最大输出)input_limit - reservedtoken_count >= 180,000 时触发压缩compactedcompaction)PermissionNext.fromConfig({ "*": "deny" }))"Provide a detailed prompt for continuing our conversation above.
Focus on information that would be helpful for continuing the conversation,
including what we did, what we're doing, which files we're working on,
and what we're going to do next considering new session will not have access to our conversation."summary: truecompaction 标记,记录压缩点src/provider/models.ts),每次启动时会更新本地缓存。| 模型 | Provider | Context | Output | 触发阈值* |
|---|---|---|---|---|
| Claude Sonnet 4.5 | Anthropic | 200,000 | 64,000 | ~168,000 |
| Claude Opus 4.5 | Anthropic | 200,000 | 64,000 | ~168,000 |
| Gemini 3 Pro | 1,000,000 | 64,000 | ~968,000 | |
| Gemini 3 Flash | 1,048,576 | 65,536 | ~1,016,536 | |
| GPT 5.2 Pro | OpenAI | 400,000 | 128,000 | ~368,000 |
| GPT 5.2 | OpenAI | 400,000 | 128,000 | ~368,000 |
| GLM 4.7 | ZhipuAI | 204,800 | 131,072 | ~172,728 |
| DeepSeek Chat | DeepSeek | 128,000 | 8,192 | ~119,808 |
*触发阈值 = context - min(output, 32,000),仅供参考,实际值以 models.dev 为准
Context
145,234 tokens 73% used