-
-
Notifications
You must be signed in to change notification settings - Fork 80.7k
opencode-go plugin: model contextWindow not loaded, all models fall back to 200K #92912
Copy link
Copy link
Closed
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Description
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.no-staleExclude from stale automationExclude from stale automation
Type
Fields
Priority
None yet
Summary
The
opencode-goplugin defines a static model catalog with 19+ models including correctcontextWindowvalues (e.g.,deepseek-v4-pro: 1_000_000). However, the plugin does NOT register these into the runtime model context window cache, soresolveContextTokensForModel()falls back to 200K.Impact
Every agent using
opencode-gomodels has premature compaction — the threshold is calculated ascontextWindow - reserveTokens - softThresholdTokens, which becomes 156K instead of 956K (6x too frequent).Root Cause
provider-catalog.js) defines correctcontextWindow: 1e6resolveContextTokensForModel()looks uplookupContextTokens("opencode-go/deepseek-v4-pro")→ miss?? 2e5(200K) inresolveMemoryFlushContextWindowTokens()The plugin
openclaw.plugin.jsonincludesmodelCatalog.providers.opencode-gobut the onboarding pipeline does not populate theMODEL_CONTEXT_TOKEN_CACHEfrom the plugin catalog.Evidence
Source (
provider-catalog-BakzcJID.js:12-35):Runtime (
context-fjzFpTQH.js:215-252):Caller (
agent-runner.runtime-Duta-cpW.js:244-251):Real-world data from live gateway (
agent:mainsession, 2026-06-14):contextTokens: 1000000insystemPromptReportcompactionCheckpoints)Workaround
Manually add
models.providers.opencode-goinopenclaw.jsonwith full model list includingcontextWindow.Proposed Fix
The plugin onboarding pipeline should register model
contextWindowvalues into the runtime cache solookupContextTokensreturns correct values for all plugin-provided models, without requiring manual config overrides.