Skip to content

[FEATURE]: Expose opt-in 1M context variants for GPT-5.6 OAuth #46527

Closed

Description

@rhan637

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

The Codex OAuth backend now supports a 1,000,000-token context window for GPT-5.6 models. However, OpenCode still applies the previous 400,000 context / 272,000 input / 128,000 output limits to these models when OpenAI OAuth is used, preventing users from using the longer context window through OpenCode.

This is different from the public OpenAI API, which exposes a 1,050,000-token context window. The Codex OAuth backend supports 1,000,000 tokens instead, leaving a maximum input budget of 872,000 tokens when 128,000 tokens are reserved for output.

I have verified the 1,000,000 context / 872,000 input / 128,000 output limits through actual testing in Codex.

References:

I propose keeping the existing GPT-5.6 OAuth models and limits unchanged as the default while adding explicit, selectable -1m variants.

Proposed behavior:

  • Keep the existing GPT-5.6 OAuth models at 400K context / 272K input / 128K output.
  • Add opt-in -1m variants for GPT-5.6 Sol, Terra, Luna, and their Fast variants.
  • Configure the new variants with 1M context / 872K input / 128K output.
  • Resolve the default and -1m variants to the same underlying OpenAI model ID.
  • Preserve the existing model options and reasoning variants.
  • Do not affect GPT-5.5 or API-key authentication.
  • Allow users to switch back to the existing default models at any time.

I already have a focused local implementation with tests covering the default models, the new -1m variants, their limits, and their underlying API model IDs.

Activity

  1. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

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

  2. rhan637 commented on Sep 1, 2026

    @rhan637
    Author

    Thanks for pointing this out. I believe #46527 is related to #44821, but it proposes a narrower and different change.

    #44821 investigates the physical maximum input accepted by the OAuth endpoint and discusses dynamic or override-based limit resolution. This request does not attempt to determine or expose that physical endpoint maximum.

    Instead, it proposes exposing the opt-in long-context tier already defined by Codex itself:

    • The bundled GPT-5.6 Sol, Terra, and Luna metadata uses context_window: 272000 and max_context_window: 872000.
    • Codex has a test confirming that setting model_context_window to 1_000_000 resolves these three models to 872_000.

    Sources:

    OpenCode currently exposes only the conservative OAuth limits. #46527 proposes mirroring Codex's two-tier behavior:

    • keep the existing 272K input budget as the default;
    • add an explicit opt-in model entry using a 1M total context budget, with 872K input and 128K output;
    • leave API-key authentication and existing defaults unchanged.

    Therefore, #44821 addresses the broader endpoint-capacity and dynamic-resolution problem, while #46527 proposes a specific selectable model-catalog feature based on Codex's existing long-context ceiling.

  3. mary-ext commented on Sep 4, 2026

    @mary-ext

    if anyone comes into here looking for a plugin form

    import type { Plugin } from "@opencode-ai/plugin";
    
    const plugin: Plugin = async () => {
      return {
        provider: {
          id: "openai",
          async models(provider, ctx) {
            if (ctx.auth?.type !== "oauth") {
              return provider.models;
            }
    
            const models = { ...provider.models };
            for (const [modelId, model] of Object.entries(provider.models)) {
              if (!modelId.startsWith("gpt-5.6-")) {
                continue;
              }
    
              const longModelId = `${modelId}-1m`;
    
              models[longModelId] = {
                ...model,
                name: `${model.name} (1M context)`,
                limit: {
                  context: 1_000_000,
                  input: 872_000,
                  output: 128_000,
                },
              };
            }
    
            return models;
          },
        },
      };
    };
    
    export default plugin;
  4. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed proposal and the Codex references! You're asking for opt-in -1m versions of the GPT-5.6 Sol/Terra/Luna models (and their Fast versions) on ChatGPT sign-in. They would have a 1M context / 872K input / 128K output limit, while the current models keep their 272K input limit. Maintainers will consider it.

    This was filed while v1 was the main line, and #46574 was closed asking for a port to v2. The request still applies to v2, where the cap now lives in a separate built-in plugin, opencode.provider.openai-context-caps (#58194).

    v2 already has two documented ways around the cap:

    To get a long-context entry next to the default one, you can also try a config alias with modelID (see "Aliases" in the models docs). I haven't checked that an alias's limit takes precedence over the cap, so please confirm it shows the higher limit:

    {
      "providers": {
        "openai": {
          "models": {
            "gpt-5.6-sol-1m": {
              "modelID": "gpt-5.6-sol",
              "name": "GPT 5.6 Sol (1M)",
              "limit": { "context": 1000000, "input": 872000, "output": 128000 }
            }
          }
        }
      }
    }

    Related issues:

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions