Answer: Compaction in OpenCode is limited by model selection, available history, size, recovery, and storage: it honors agents.compaction.model or the session's model, needs older conversation to replace, sends a shortened text version if the conversation is too long, retries once after a too-long rejection, and leaves earlier messages stored. It cannot create room when a request is mostly fixed instructions and tool schemas. Status: Confirmed Entry: tool/opencode/pricing-and-limits/compaction-limits Revision: 2 Digest: sha256:1a71aaba0a498e2b (changes whenever the content changes) Timeline: Created: 2026-11-13T13:29:42Z Last changed: 2026-11-17T14:11:48Z (Example: — → 128k context = 120k fixed instructions and tools + 8k conversation) Last verified: 2026-11-20T13:45:38Z Next check: 2026-11-21T13:45:38Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of Model | compaction honors agents.compaction.model ; otherwise it uses the session’s model | [1] | 2026-11-20 Native compaction model | Native compaction always uses the session’s model | [1] | 2026-11-20 History | Compaction needs older conversation to replace | [1] | 2026-11-20 Size | OpenCode sends a shortened text version and may leave out the oldest exchanges | [1] | 2026-11-20 Recovery | A request rejected as too long is compacted and retried once | [1] | 2026-11-20 Storage | Earlier messages remain stored even when they are no longer sent to the model | [1] | 2026-11-20 Example | 128k context = 120k fixed instructions and tools + 8k conversation | [1] | 2026-11-20 Sources: [1] opencode. "Compaction | OpenCode". https://opencode.ai/docs/compaction/ Role: primary. Accessed: 2026-11-20T13:45:38Z Quote: "compaction honors agents.compaction.model ; otherwise it uses the session’s model" (Supports: Model) Quote: "Native compaction always uses the session’s model" (Supports: Native compaction model) Quote: "Compaction needs older conversation to replace" (Supports: History) Quote: "OpenCode sends a shortened text version and may leave out the oldest exchanges" (Supports: Size) Quote: "A request rejected as too long is compacted and retried once" (Supports: Recovery) Quote: "Earlier messages remain stored even when they are no longer sent to the model" (Supports: Storage) Quote: "128k context = 120k fixed instructions and tools + 8k conversation" (Supports: Example) Snapshot SHA-256: d245d3913694ae5b9552728fe64aa35b9b6a51b4fe3b34c67b4f94f792d2f767 (captured 2026-11-17T14:11:45Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-17T14:11:48Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T13:45:38Z. No independent second source is configured for this entry Last successful check: 2026-11-20T13:45:38Z Last attempt: 2026-11-20T13:45:38Z Notes and limitations: Extracted automatically from a single official source (section "Limits"). Related: https://latestn.com/tool/opencode/pricing-and-limits/console-pricing-free-models Which models are free in opencode Console and how does pricing work? https://latestn.com/tool/opencode/pricing-and-limits/console-subscription-plans What subscription plans does the opencode Console offer and how much do they cost? https://latestn.com/tool/opencode/pricing-and-limits/free-tier-403 Why do free-tier chat models return HTTP 403 in the opencode Inference API? https://latestn.com/tool/opencode/pricing-and-limits/auto-recharge How do I set up auto-recharge for opencode Console credits? https://latestn.com/tool/opencode/pricing-and-limits/auto-recharge-budgets How does auto-recharge and budgets work in opencode Console? https://latestn.com/tool/opencode/pricing-and-limits/budget-reached-behavior What happens in opencode when a budget is reached? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-17T14:11:48Z | changed | Example: — → 128k context = 120k fixed instructions and tools + 8k conversation | [1] 2026-11-17T14:11:48Z | changed | Native compaction model: — → Native compaction always uses the session’s model | [1] 2026-11-17T14:11:48Z | changed | Example limit: 128k context = 120k fixed instructions and tools + 8k conversation → — | [1] 2026-11-13T13:29:42Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/opencode/pricing-and-limits/compaction-limits/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/opencode/pricing-and-limits/compaction-limits POST: https://latestn.com/dispute/tool/opencode/pricing-and-limits/compaction-limits with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/opencode/pricing-and-limits/compaction-limits?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). What are the limits of compaction in opencode? Revision 2, last verified 2026-11-20T13:45:38Z. https://latestn.com/tool/opencode/pricing-and-limits/compaction-limits (accessed 2026-11-21T09:53:07Z). @misc{LatestN_tool_opencode_pricing_and_limits_compaction_limits_r2, title = {What are the limits of compaction in opencode?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/opencode/pricing-and-limits/compaction-limits}}, note = {Revision 2; digest sha256:1a71aaba0a498e2b; last verified 2026-11-20T13:45:38Z; accessed 2026-11-21T09:53:07Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/opencode/pricing-and-limits/compaction-limits