Commit 996d7b7
committed
fix(opencode-go): register model catalog via applyProviderConfigWithModelCatalog
Previously, applyOpencodeGoProviderConfig was an empty no-op that returned
cfg unchanged. This meant the opencode-go plugin's static model catalog
(including correct contextWindow values like deepseek-v4-pro: 1M) was
never registered into the runtime model context window cache.
As a result, resolveContextTokensForModel() failed to look up any
opencode-go model and fell back to the hardcoded 200K default, causing
premature compaction (threshold 156K instead of 956K).
Changes:
- Export OPENCODE_GO_MODELS and OPENCODE_GO_OPENAI_BASE_URL from
extensions/opencode-go/provider-catalog.ts
- Implement applyOpencodeGoProviderConfig to call
applyProviderConfigWithModelCatalog with the full static model catalog,
matching the pattern used by deepseek and other built-in providers.
Fixes: agent compaction triggering at ~156K tokens on 1M context models
Refs: #929121 parent e99ab38 commit 996d7b7
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
10 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
0 commit comments