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 — [backend] Port 1M context / adaptive thinking for Opus 4.6 (upstream #12338) · Issue #150 · randomm/opencode

[backend] Port 1M context / adaptive thinking for Opus 4.6 (upstream #12338) #150

New issue
Copy link
New issue
Copy link
Closed
Closed
[backend] Port 1M context / adaptive thinking for Opus 4.6 (upstream #12338)#150
Copy link

Description

@randomm
randomm
opened on Feb 6, 2026
Issue body actions

Description

Port upstream PR anomalyco#12342 to enable 1M context window and adaptive thinking for Claude Opus 4.6.

Scope

This is a major AI SDK upgrade (v5→v6) with breaking changes. Not a simple cherry-pick.

Changes Required

Phase 1 - Minimal (just headers + adaptive thinking):

  • Add context-1m-2025-08-07 beta header to Anthropic provider
  • Add adaptive-thinking-2026-01-28 beta header
  • Add adaptive thinking detection for Opus 4.6 in transform.ts
  • Convert budgetTokens → effort for Opus 4.6 models

Phase 2 - SDK Upgrade (breaking changes):

  • Upgrade ai 5.0.124 → 6.0.72
  • Upgrade all @ai-sdk/* packages (18+ packages)
  • Migrate LanguageModelV2 → LanguageModelV3
  • Make toModelMessages async
  • Rename tool factory functions
  • Update test suites for new usage types
  • Fix compaction token counting bug

Key Files

  • packages/opencode/src/provider/provider.ts - Beta headers
  • packages/opencode/src/provider/transform.ts - Adaptive thinking logic
  • packages/opencode/src/session/compaction.ts - Token counting
  • packages/opencode/src/session/llm.ts - Async migration
  • packages/opencode/src/session/prompt.ts - Type migration
  • packages/opencode/src/provider/sdk/copilot/responses/tool/* - Factory renames

Upstream Reference

  • Issue: 1M tokens for Opus 4.6 anomalyco/opencode#12338
  • PR: feat(provider): add adaptive thinking and 1M context support for Claude Opus 4.6 anomalyco/opencode#12342

Quality Gates

  • Tests pass
  • Type checking passes
  • Manual test: Opus 4.6 with >200k tokens

Activity

  1. randomm
    added 2 commits that reference this issue on Feb 6, 2026

    feat(opencode): enable 1M context + adaptive thinking for Opus 4.6 (#150

    7cc8dab

    feat(opencode): enable 1M context + adaptive thinking for Opus 4.6 (#150

    43f95f8
  2. randomm commented on Feb 6, 2026

    @randomm
    randomm
    on Feb 6, 2026
    OwnerAuthor
    More actions

    Merged in PR #152 - 1M context headers and adaptive thinking for Opus 4.6

  3. randomm
    closed this as completedon Feb 6, 2026
  4. okhsunrog commented on Feb 6, 2026

    @okhsunrog
    okhsunrog
    on Feb 6, 2026
    More actions

    @randomm could you explain to me what's happening here? I didn't get any review on my PR and I see a PR with a similar name getting merged, but obviously incomplete, as it doesn't actually enable adaptive thinking.
    type: "enabled" is for manual thinking with budgetTokens. Adaptive thinking requires type: "adaptive".

  5. okhsunrog commented on Feb 6, 2026

    @okhsunrog
    okhsunrog
    on Feb 6, 2026
    More actions

    ah, sorry, I see that it's your fork, not opencode official repo

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

Metadata

Metadata

Assignees

No one assigned

    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.