GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — How to enable 1M context in OpenCode for GPT-5.4? Compaction triggers at 272k, not 1M · Issue #16308 · anomalyco/opencode

How to enable 1M context in OpenCode for GPT-5.4? Compaction triggers at 272k, not 1M #16308

New issue
Copy link
New issue
Copy link
Closed
Closed
How to enable 1M context in OpenCode for GPT-5.4? Compaction triggers at 272k, not 1M#16308
Copy link
Assignees
thdxr
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)

Description

@InCerryGit
InCerryGit
opened on Mar 6, 2026
Issue body actions

Question

I see that OpenAI (e.g., GPT-5.4 or Claude 3.5) officially advertises 1M context window support, but when using these models in OpenCode, compaction is triggered as soon as the session approaches 272k tokens (sometimes even earlier), and the context never comes close to the full 1M tokens advertised.

My compaction config is:

  "compaction": {
    "auto": true,
    "prune": true,
    "reserved": 16000
  }

Based on the documentation and codebase, it seems overflow/compaction is triggered using the provider/model's limit.input minus the reserved buffer. Here are my questions:

  1. Does OpenCode actually support the new 1M-token context for GPT-�3 or GPT-5.4? Or is it possible that the provider/model metadata is still set to the legacy window size?
  2. Is there a way to explicitly configure or pass model_context_window / model_auto_compact_token_limit (or similar params) in opencode to activate or test the real 1M window?
  3. Are there any best practices, config tweaks, or workarounds to enable the extended context and prevent premature compaction at ~272k?
  4. If true 1M context support is not yet possible, what is the recommended solution to make full use of the model's real window size?

Any guidance or clarification would be greatly appreciated!

Reacted by Sergey Kostrukov, Ciprian Cimpan, Samuel Beer, syo093c, kodandaravi, Rahman Adianto and Benjamin Rabinowitz

Activity

  1. github-actions
    assigned
    thdxr
    on Mar 6, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 6, 2026
  3. github-actions commented on Mar 6, 2026

    @github-actions
    github-actionsBot
    on Mar 6, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • Auto-compaction triggers at ~200k tokens instead of model's actual context window (1M) #15871: Auto-compaction triggers at ~200k tokens instead of model's actual context window (1M) — describes the same symptom of compaction firing well below the advertised 1M limit
    • [FEATURE]: Allow overriding model input limits for OpenAI long-context models #16298: [FEATURE]: Allow overriding model input limits for OpenAI long-context models — directly addresses the ability to configure the context window size to avoid premature compaction

    Please review those issues and consider adding your information there rather than opening a new one.

  4. TomLucidor commented on Mar 9, 2026

    @TomLucidor
    TomLucidor
    on Mar 9, 2026
    More actions

    Similar issues here where the defaults are all wrong #16709

  5. rekram1-node
    closed this as completedon Apr 6, 2026
  6. MartyMcFlyInTheSky commented on Apr 21, 2026

    @MartyMcFlyInTheSky
    MartyMcFlyInTheSky
    on Apr 21, 2026
    More actions

    Same here. In general options to control the context window are dearly lacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @thdxr
    thdxr

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.