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 — 1M tokens for Opus 4.6 · Issue #12338 · anomalyco/opencode

1M tokens for Opus 4.6 #12338

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
1M tokens for Opus 4.6#12338
Copy link
Assignees
fwang

Description

@Nepomuk5665
Nepomuk5665
opened on Feb 5, 2026
Issue body actions

Description

It says: 185,336 19% ($0.00)
When I go over 200k tokens: prompt is too long: 203831 tokens > 200000 maximum
Have tried to turn on:
Image

just tried it with a API key also doesnt allow me to go over 200k tokens.

Found out how to do it! PLEASE add the beta header: betas=["context-1m-2025-08-07"] @fwang

Plugins

OpenCode version

v1.1.52

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

MacOS

Terminal

Terminal

Reacted by nil0ft, Bucur David, Emre Kaşgür, anna-domachowska, Wendell Misiedjan, theopicht, Phieu Dinh, Tema Smirnov, Stanislas, Ercin Dedeoglu and 15 more
Reacted by Ted Robertson
Reacted by Emre Kaşgür, Wendell Misiedjan and Rajesh Rajendran

Activity

Next
  1. Nepomuk5665
    added
    bugSomething isn't working
    on Feb 5, 2026
  2. github-actions
    assigned
    fwang
    on Feb 5, 2026
  3. github-actions
    added
    zenRelates to Zen
    on Feb 5, 2026
  4. github-actions commented on Feb 5, 2026

    @github-actions
    github-actionsBot
    on Feb 5, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Stuck at "prompt is too long" #8726: Stuck at "prompt is too long" - Reports being stuck with the same "prompt is too long: X tokens > 200000 maximum" error
    • [v0.1.158] [Anthropic: Claude Sonnet 4]: AI_APICallError: prompt is too long: 209840 tokens › 200000 maximum #500: [v0.1.158] [Anthropic: Claude Sonnet 4]: AI_APICallError: prompt is too long: 209840 tokens › 200000 maximum - Similar token limit error with Claude model
    • prompt is too long #5360: prompt is too long - Another instance of exceeding the 200k token limit
    • TOKEN_REFRESH_NEEDED error incorrectly thrown for context overflow (400 prompt too long) #12135: TOKEN_REFRESH_NEEDED error incorrectly thrown for context overflow (400 prompt too long) - Related context overflow handling issue

    Feel free to ignore if your specific case differs from these existing issues.

  5. GeneCodeSavvy commented on Feb 5, 2026

    @GeneCodeSavvy
    GeneCodeSavvy
    on Feb 5, 2026
    Contributor
    More actions

    The context-1m-2025-08-07 beta header is currently only added for Sonnet models (claude-sonnet-*), but Opus 4.6 also supports 1M context per Anthropic's docs (https://docs.anthropic.com/en/docs/build-with-claude/context-windows#1m-token-context-window).

    The fix would be to simply extend the check to also match claude-opus-4-6.

    per the docs, only Sonnet 4 and Sonnet 4.5, Opus 4.6 supports 1M context, so the condition should be specific imho.

    should I open a PR with the fix ? @fwang

    Reacted by Ted Robertson
  6. okhsunrog commented on Feb 5, 2026

    @okhsunrog
    okhsunrog
    on Feb 5, 2026
    More actions

    Could you test #12342 ? 1M token window works for me with Opus 4.6, at least I went over 300k tokens without any issues

    Reacted by Ted Robertson and Hudson Burke
  7. okhsunrog commented on Feb 5, 2026

    @okhsunrog
    okhsunrog
    on Feb 5, 2026
    More actions

    I didn't add context-1m-2025-08-07 header but it still seem to work, can anyone else confirm that? Can you test both with Oauth and Anthropic API?

  8. ItsWendell commented on Feb 5, 2026

    @ItsWendell
    ItsWendell
    on Feb 5, 2026
    Contributor
    More actions

    Just ran into this issue with OAuth Claude Code Max plan on version 1.1.52 @okhsunrog

    Image
    Reacted by Ercin Dedeoglu, Z1xus, Leonid Meleshin, chuck ma, Jason George and Tizian Maxime Weigt
  9. okhsunrog commented on Feb 5, 2026

    @okhsunrog
    okhsunrog
    on Feb 5, 2026
    More actions

    @ItsWendell are you using my branch? https://github.com/okhsunrog/opencode/tree/feat/opus-4-6-adaptive-thinking
    It works for me with Claude Max, OAuth:

    Image Image

    you can try adding the header context-1m-2025-08-07 and run it, tell me if it works

  10. ItsWendell commented on Feb 6, 2026

    @ItsWendell
    ItsWendell
    on Feb 6, 2026
    Contributor
    More actions

    @okhsunrog also mentioning here, there's issues when hitting other thresholds, e.g. 400k tokens:

    #12342 (comment)

  11. okhsunrog commented on Feb 6, 2026

    @okhsunrog
    okhsunrog
    on Feb 6, 2026
    More actions

    Added more context in #12342 (comment) and #12342 (comment)

  12. ErcinDedeoglu commented on Feb 6, 2026

    @ErcinDedeoglu
    ErcinDedeoglu
    on Feb 6, 2026
    More actions

    This is disrupting flow. It is impossible to use Opus-4.6

    Reacted by Jason George
    Reacted by Andres Gutierrez, qqqq1112323, chuck ma, Jason George and Mattwmaster58
  13. nukeop commented on Feb 8, 2026

    @nukeop
    nukeop
    on Feb 8, 2026
    More actions

    This worked for like a day or so (correct 1M context), now it starts compacting the session even before hitting 200 000. It's very disruptive.

    Reacted by Ted Robertson and Le Duy Phuc
  14. 22 remaining items

  15. MoaidHathot commented on Apr 3, 2026

    @MoaidHathot
    MoaidHathot
    on Apr 3, 2026
    More actions

    I agree with @azaricstefan, I think we should also support the Opus 4.6 1M from the GitHub Copilot model hosting.

  16. MoaidHathot commented on Apr 3, 2026

    @MoaidHathot
    MoaidHathot
    on Apr 3, 2026
    More actions

    @azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14
    Add the following to your opencode.json

      "provider": {
        "github-copilot": {
          "models": {
            "claude-opus-4.6-1m": {
              "name": "Claude Opus 4.6 (1M)",
              "family": "claude-opus",
              "attachment": true,
              "reasoning": true,
              "tool_call": true,
              "temperature": true,
              "modalities": {
                "input": ["text", "image"],
                "output": ["text"]
              },
              "cost": {
                "input": 0,
                "output": 0
              },
              "limit": {
                "context": 1000000,
                "output": 64000
              }
            }
          }
        }
      },

    Then, you need to have the following plugin. Just put this file (copilot-1m.ts) under /plugins in your OpenCode config directory:

    import type { Hooks } from "@opencode-ai/plugin";
    
    export default function (): Hooks {
      return {
        "chat.headers": async (incoming, output) => {
          if (!incoming.model.providerID.includes("github-copilot")) return;
          output.headers["Copilot-Integration-Id"] = "copilot-developer-cli";
        },
      };
    }

    Example config:
    https://github.com/MoaidHathot/Neovim-Moaid/tree/main/config/opencode

    Reacted by Stefan Azarić
    Reacted by Stefan Azarić
  17. azaricstefan commented on Apr 3, 2026

    @azaricstefan
    azaricstefan
    on Apr 3, 2026
    More actions

    @azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json

    "provider": {
    "github-copilot": {
    "models": {
    "claude-opus-4.6-1m": {
    "name": "Claude Opus 4.6 (1M)",
    "family": "claude-opus",
    "attachment": true,
    "reasoning": true,
    "tool_call": true,
    "temperature": true,
    "modalities": {
    "input": ["text", "image"],
    "output": ["text"]
    },
    "cost": {
    "input": 0,
    "output": 0
    },
    "limit": {
    "context": 1000000,
    "output": 64000
    }
    }
    }
    }
    },
    Then, you need to have the following plugin. Just put this file (copilot-1m.ts) under /plugins in your OpenCode config directory:

    import type { Hooks } from "@opencode-ai/plugin";

    export default function (): Hooks {
    return {
    "chat.headers": async (incoming, output) => {
    if (!incoming.model.providerID.includes("github-copilot")) return;
    output.headers["Copilot-Integration-Id"] = "copilot-developer-cli";
    },
    };
    }
    Example config: https://github.com/MoaidHathot/Neovim-Moaid/tree/main/config/opencode

    This worked! I tried adding just to opencode.json before but missed adding this hook in plugins.

    Reacted by Moaid Hathot
  18. IlyaMaksheev commented on Apr 3, 2026

    @IlyaMaksheev
    IlyaMaksheev
    on Apr 3, 2026
    More actions

    @azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json

    Is it possible to make it work with Anthropic subscription? I was not able to do so.

  19. MoaidHathot commented on Apr 4, 2026

    @MoaidHathot
    MoaidHathot
    on Apr 4, 2026
    More actions

    @azaricstefan I was able to support it using configuration + a plugin that is required for v1.3.13 but should not be required for v1.3.14 Add the following to your opencode.json

    Is it possible to make it work with Anthropic subscription? I was not able to do so.

    @IlyaMaksheev, this fix is specific for the Github subscription and the way it works. For Anthropic I think you need a different solution, although @omd0 says there is an Anthropic plugins that works. Maybe that can help?

    Reacted by IlyaMaksheev
  20. omd0 commented on Apr 4, 2026

    @omd0
    omd0
    on Apr 4, 2026
    More actions

    OpenCode doesn't support Anthropic officially anymore, but this community plugin works great.
    https://github.com/ex-machina-co/opencode-anthropic-auth

    Reacted by Ted Robertson
  21. tredondo commented on Apr 10, 2026

    @tredondo
    tredondo
    on Apr 10, 2026
    More actions

    @omd0 that commit applied only to Claude subscriptions. You can still use Anthropic with your own API keys.

  22. omd0 commented on Apr 11, 2026

    @omd0
    omd0
    on Apr 11, 2026
    More actions

    I switch to this: https://github.com/shahidshabbir-se/opencode-anthropic-oauth
    it's just work!

  23. lanej
    added 2 commits that reference this issue on May 2, 2026

    feat(opencode): enable 1M token context window for Vertex AI

    6d56ef7

    feat(opencode): add plugin to enable 1M token context for Vertex AI

    b909f0e
  24. thdxr
    removed
    bugSomething isn't working
    zenRelates to Zen
    on May 3, 2026
  25. rasmusjosefsson commented on May 19, 2026

    @rasmusjosefsson
    rasmusjosefsson
    on May 19, 2026
    More actions

    Made a plugin for Copilot users based on the findings in this thread.

    {
      "plugin": ["opencode-copilot-1m"]
    }
    

    Source https://github.com/rasmusjosefsson/opencode-copilot-1m

  26. github-actions commented on Jul 19, 2026

    @github-actions
    github-actionsBot
    on Jul 19, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  27. github-actions
    closed this as not plannedon Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @fwang
    fwang

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

    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.