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 — [FEATURE]: Allow overriding model input limits for OpenAI long-context models · Issue #16298 · anomalyco/opencode

[FEATURE]: Allow overriding model input limits for OpenAI long-context models #16298

New issue
Copy link
New issue
Copy link
Closed
#16306
Closed
[FEATURE]: Allow overriding model input limits for OpenAI long-context models#16298
#16306
Copy link
Assignees
thdxr
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Description

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

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

I would like opencode to support user-overridable input limits for OpenAI models such as gpt-5.4, or otherwise align its effective limits more closely with the official OpenAI model documentation.
Background
OpenAI documents gpt-5.4 as having a 1,050,000 token context window and 128,000 max output tokens.
In opencode, openai:gpt-5.4 currently appears to be loaded with:

  • context: 1,050,000
  • input: 272,000
  • output: 128,000
    Because opencode's compaction logic prefers model.limit.input when it is present, long conversations may be compacted much earlier than users would expect from the official GPT-5.4 context window.
    Requested enhancement
    Please consider one of the following:
  1. Allow provider.models.<model>.limit.input to be overridden in user config, and make sure that override is respected at runtime.
  2. Add an explicit advanced setting to opt into the full documented long-context budget for supported models/providers.
  3. Revisit the metadata source used for OpenAI GPT-5.x models so opencode does not enforce a much smaller effective input budget unless there is a confirmed upstream reason.
    Why this would help
  • It would let advanced users fully use the long-context models they are already paying for.
  • It would reduce unnecessary early compaction and summarization.
  • It would make model behavior more predictable and closer to official provider documentation.
  • It would improve parity with OpenAI's own tooling, where client-side context budget is configurable.
    Additional note
    This request is not asking opencode to bypass any upstream provider limits. It is only asking for either:
  • more accurate defaults, or
  • a user-visible override for the client-side/model-metadata limit that opencode uses for compaction decisions.
    If the current 272,000 input limit is intentional because of a known upstream constraint, documenting that clearly would also be very helpful.
Reacted by Tarek Haoula, Raymel, Brendan Duke, Sergey Kostrukov, vyls and Jun Guo

Activity

  1. ykswang
    added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Mar 6, 2026
  2. github-actions
    assigned
    thdxr
    on Mar 6, 2026
  3. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 6, 2026
  4. 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:

    • GPT 5.2 Codex - Compaction happens way too early and context limit is wrong #11086: GPT 5.2 Codex - compaction happens way too early and context limit is wrong (same core problem with OpenAI model input limits causing early compaction)
    • Codex: default vs selected variants show different effective context; support per-variant limits #12416: Codex: default vs selected variants show different effective context; support per-variant limits (requests per-model limit overrides in config, very similar ask)
    • Feature Request: Configurable context limit and auto-compaction threshold #8140: Feature Request: Configurable context limit and auto-compaction threshold (overlapping request for user-configurable model limits)
    • Default Codex context length not matching Pro plan #7705: Default Codex context length not matching Pro plan (related discrepancy between documented and enforced context limits)

    Please review these issues to see if your request is already covered or can be addressed as part of an existing discussion.

  5. ykswang commented on Mar 6, 2026

    @ykswang
    ykswang
    on Mar 6, 2026
    ContributorAuthor
    More actions

    I originally opened this as a feature request, but after tracing the implementation this looks more like a bug in the existing model override behavior.
    Specifically, provider.models.<model>.limit.input is currently ignored in two places:

    1. config validation does not allow partial limit overrides such as:
      {
        "provider": {
          "anthropic": {
            "models": {
              "claude-sonnet-4-20250514": {
                "limit": { "input": 123456 }
              }
            }
          }
        }
      }
    2. during provider model merging, limit.input is not preserved/applied at runtime.
      This means model-level input limit overrides are ineffective even though model overrides already exist for other fields.
      I'm preparing a small fix that:
    • allows partial limit overrides in config
    • preserves and applies limit.input at runtime
    • adds regression tests
    Reacted by Raymel, Brendan Duke, Sergey Kostrukov, Jun Guo and Charles Pascoe
  6. rekram1-node
    closed this as completedin #16306on Apr 3, 2026
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)discussionUsed for feature requests, proposals, ideas, etc. Open discussion

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.