GeezerVison is showing github.com — force models.dev refresh on auth login · steipete/opencode@71cd84d
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: opencode.json +4-29Lines changed: 4 additions & 29 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 1 | 1 | { | 2 | 2 | "$schema": "https://opencode.ai/config.json", | 3 | 3 | "provider": { | 4 | | - "openrouter": { | 5 | | - "models": { | 6 | | - "moonshotai/kimi-k2": { | 7 | | - "options": { | 8 | | - "provider": { | 9 | | - "order": ["baseten"], | 10 | | - "allow_fallbacks": false | 11 | | - } | 12 | | - } | 13 | | - } | 14 | | - } | 15 | | - }, | 16 | | - "huggingface": { | 17 | | - "models": { | 18 | | - "Qwen/Qwen3-235B-A22B-Instruct-2507:fireworks-ai": {} | 19 | | - } | 20 | | - }, | 21 | | - "local": { | 22 | | - "npm": "@ai-sdk/openai-compatible", | 23 | | - "name": "Local", | | 4 | + "cerebras": { | 24 | 5 | "options": { | 25 | | - "baseURL": "http://127.0.0.1:1234/v1", | 26 | | - "includeUsage": true | | 6 | + "apiKey": "csk-m33xrvt43whkypn8r4ph9xc8fenhx2f68c3pj22ext45v5k9" | 27 | 7 | }, | | 8 | + "npm": "@ai-sdk/cerebras", | 28 | 9 | "models": { | 29 | | - "qwen/qwen3-coder-30b": { | 30 | | - "name": "Qwen-Coder 30B", | 31 | | - "limit": { | 32 | | - "context": 262144, | 33 | | - "output": 66536 | 34 | | - } | 35 | | - } | | 10 | + "qwen-3-coder-480b": {} | 36 | 11 | } | 37 | 12 | } | 38 | 13 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/cli/cmd/auth.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -100,6 +100,7 @@ export const AuthLoginCommand = cmd({ | 100 | 100 | prompts.outro("Done") | 101 | 101 | return | 102 | 102 | } | | 103 | + await ModelsDev.refresh().catch(() => {}) | 103 | 104 | const providers = await ModelsDev.get() | 104 | 105 | const priority: Record<string, number> = { | 105 | 106 | anthropic: 0, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/global/index.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,7 +27,7 @@ await Promise.all([ | 27 | 27 | fs.mkdir(Global.Path.log, { recursive: true }), | 28 | 28 | ]) | 29 | 29 |
| 30 | | -const CACHE_VERSION = "3" | | 30 | +const CACHE_VERSION = "4" | 31 | 31 |
| 32 | 32 | const version = await Bun.file(path.join(Global.Path.cache, "version")) | 33 | 33 | .text() | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/lsp/index.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -84,6 +84,7 @@ export namespace LSP { | 84 | 84 | } | 85 | 85 | return { | 86 | 86 | broken: new Set<string>(), | | 87 | + servers, | 87 | 88 | clients, | 88 | 89 | } | 89 | 90 | }, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/provider/models.ts +9-3Lines changed: 9 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -61,13 +61,19 @@ export namespace ModelsDev { | 61 | 61 |
| 62 | 62 | export async function refresh() { | 63 | 63 | const file = Bun.file(filepath) | 64 | | - log.info("refreshing") | | 64 | + log.info("refreshing", { | | 65 | + file, | | 66 | + }) | 65 | 67 | const result = await fetch("https://models.dev/api.json", { | 66 | 68 | headers: { | 67 | 69 | "User-Agent": Installation.USER_AGENT, | 68 | 70 | }, | 69 | | - }).catch(() => {}) | 70 | | - if (result && result.ok) await Bun.write(file, result) | | 71 | + }).catch((e) => { | | 72 | + log.error("Failed to fetch models.dev", { | | 73 | + error: e, | | 74 | + }) | | 75 | + }) | | 76 | + if (result && result.ok) await Bun.write(file, await result.text()) | 71 | 77 | } | 72 | 78 | } | 73 | 79 |
| |
|