Skip to content

Commit 044bfc8

Browse files
Merge branch 'dev' into fix-env-caching-12698
2 parents eb69ec1 + 3beadee commit 044bfc8

43 files changed

Lines changed: 855 additions & 1418 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.opencode/agent/translator.md

Lines changed: 0 additions & 899 deletions
This file was deleted.

.opencode/command/translate.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
description: translate English to other languages
3+
model: opencode/claude-opus-4-7
4+
---
5+
6+
run git diff and translate changed english doc and UI copy files to other international languages. Translate all languages in parallel to save time.
7+
8+
Requirements:
9+
10+
- Preserve meaning, intent, tone, and formatting (including Markdown/MDX structure).
11+
- Preserve all technical terms and artifacts exactly: product/company names, API names, identifiers, code, commands/flags, file paths, URLs, versions, error messages, config keys/values, and anything inside inline code or code blocks.
12+
- Also preserve every term listed in the Do-Not-Translate glossary below.
13+
- Also apply locale-specific guidance from `.opencode/glossary/<locale>.md` when available (for example, `zh-cn.md`).
14+
- Do not modify fenced code blocks.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { APIEvent } from "@solidjs/start/server"
2+
import { getHandler, optionsHandler } from "../../util/modelsHandler"
3+
4+
export async function OPTIONS(_input: APIEvent) {
5+
return optionsHandler()
6+
}
7+
8+
export async function GET(input: APIEvent) {
9+
return getHandler({ modelList: "lite" })
10+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { ZenData } from "@opencode-ai/console-core/model.js"
2+
3+
export async function optionsHandler() {
4+
return new Response(null, {
5+
status: 200,
6+
headers: {
7+
"Access-Control-Allow-Origin": "*",
8+
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
9+
"Access-Control-Allow-Headers": "Content-Type, Authorization",
10+
},
11+
})
12+
}
13+
14+
export async function getHandler(opts: { modelList: "lite" | "full"; disabledModels?: string[] }) {
15+
const zenData = ZenData.list(opts.modelList)
16+
17+
return new Response(
18+
JSON.stringify({
19+
object: "list",
20+
data: Object.entries(zenData.models)
21+
.filter(([id]) => !opts.disabledModels?.includes(id))
22+
.filter(([id]) => !id.startsWith("alpha-"))
23+
.map(([id, _model]) => ({
24+
id,
25+
object: "model",
26+
created: Math.floor(Date.now() / 1000),
27+
owned_by: "opencode",
28+
})),
29+
}),
30+
{
31+
headers: {
32+
"Content-Type": "application/json",
33+
},
34+
},
35+
)
36+
}

packages/console/app/src/routes/zen/v1/models.ts

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,59 +3,29 @@ import { and, Database, eq, isNull } from "@opencode-ai/console-core/drizzle/ind
33
import { KeyTable } from "@opencode-ai/console-core/schema/key.sql.js"
44
import { WorkspaceTable } from "@opencode-ai/console-core/schema/workspace.sql.js"
55
import { ModelTable } from "@opencode-ai/console-core/schema/model.sql.js"
6-
import { ZenData } from "@opencode-ai/console-core/model.js"
6+
import { optionsHandler, getHandler } from "~/routes/zen/util/modelsHandler"
77

88
export async function OPTIONS(_input: APIEvent) {
9-
return new Response(null, {
10-
status: 200,
11-
headers: {
12-
"Access-Control-Allow-Origin": "*",
13-
"Access-Control-Allow-Methods": "GET, POST, OPTIONS",
14-
"Access-Control-Allow-Headers": "Content-Type, Authorization",
15-
},
16-
})
9+
return optionsHandler()
1710
}
1811

1912
export async function GET(input: APIEvent) {
20-
const zenData = ZenData.list("full")
21-
const disabledModels = await authenticate()
22-
23-
return new Response(
24-
JSON.stringify({
25-
object: "list",
26-
data: Object.entries(zenData.models)
27-
.filter(([id]) => !disabledModels.includes(id))
28-
.filter(([id]) => !id.startsWith("alpha-"))
29-
.map(([id, _model]) => ({
30-
id,
31-
object: "model",
32-
created: Math.floor(Date.now() / 1000),
33-
owned_by: "opencode",
34-
})),
35-
}),
36-
{
37-
headers: {
38-
"Content-Type": "application/json",
39-
},
40-
},
41-
)
42-
43-
async function authenticate() {
13+
const disabledModels = await (() => {
4414
const apiKey = input.request.headers.get("authorization")?.split(" ")[1]
4515
if (!apiKey) return []
4616

47-
const disabledModels = await Database.use((tx) =>
17+
return Database.use((tx) =>
4818
tx
4919
.select({
5020
model: ModelTable.model,
5121
})
5222
.from(KeyTable)
5323
.innerJoin(WorkspaceTable, eq(WorkspaceTable.id, KeyTable.workspaceID))
54-
.leftJoin(ModelTable, and(eq(ModelTable.workspaceID, KeyTable.workspaceID), isNull(ModelTable.timeDeleted)))
24+
.innerJoin(ModelTable, and(eq(ModelTable.workspaceID, KeyTable.workspaceID), isNull(ModelTable.timeDeleted)))
5525
.where(and(eq(KeyTable.key, apiKey), isNull(KeyTable.timeDeleted)))
5626
.then((rows) => rows.map((row) => row.model)),
5727
)
28+
})()
5829

59-
return disabledModels
60-
}
30+
return getHandler({ modelList: "full", disabledModels })
6131
}

packages/opencode/src/cli/cmd/tui/context/editor.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,12 +278,16 @@ function resolveEditorLockFile() {
278278
}
279279

280280
const cwd = process.cwd()
281+
// longest workspace folder that contains cwd; 0 if none match
282+
const bestMatchLength = (lock: EditorLockFile) =>
283+
Math.max(0, ...lock.workspaceFolders.map((folder) => pathContainsLength(folder, cwd)))
281284
const locks = entries
282285
.filter((entry) => entry.endsWith(".lock"))
283286
.map((entry) => readEditorLockFile(path.join(directory, entry)))
284287
.filter((entry): entry is EditorLockFile => Boolean(entry))
285-
.sort((left, right) => scoreEditorLock(right, cwd) - scoreEditorLock(left, cwd))
286-
288+
.filter((entry) => bestMatchLength(entry) > 0)
289+
// prefer locks with longer matching workspace folders, then more recent ones
290+
.sort((left, right) => bestMatchLength(right) - bestMatchLength(left) || right.mtimeMs - left.mtimeMs)
287291
return locks[0]
288292
}
289293

@@ -310,11 +314,6 @@ function readEditorLockFile(filePath: string): EditorLockFile | undefined {
310314
}
311315
}
312316

313-
function scoreEditorLock(lock: EditorLockFile, cwd: string) {
314-
const workspaceMatch = lock.workspaceFolders.some((folder) => pathContains(folder, cwd)) ? 1 : 0
315-
return workspaceMatch * 1_000_000_000_000 + lock.mtimeMs
316-
}
317-
318317
function editorSelectionKey(selection: EditorSelection | undefined) {
319318
if (!selection) return ""
320319
return [
@@ -327,9 +326,10 @@ function editorSelectionKey(selection: EditorSelection | undefined) {
327326
].join("\0")
328327
}
329328

330-
function pathContains(parent: string, child: string) {
331-
const relative = path.relative(path.resolve(parent), path.resolve(child))
332-
return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative))
329+
function pathContainsLength(parent: string, child: string) {
330+
const resolved = path.resolve(parent)
331+
const relative = path.relative(resolved, path.resolve(child))
332+
return relative === "" || (!relative.startsWith("..") && !path.isAbsolute(relative)) ? resolved.length : 0
333333
}
334334

335335
function openEditorSocket(connection: EditorConnection) {

packages/web/src/content/docs/ar/go.mdx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,22 @@ OpenCode Go حاليًا في المرحلة التجريبية.
8484

8585
يوضح الجدول أدناه عددًا تقديريًا للطلبات بناءً على أنماط استخدام Go المعتادة:
8686

87-
| Model | الطلبات لكل 5 ساعات | الطلبات في الأسبوع | الطلبات في الشهر |
88-
| ----------------- | ------------------- | ------------------ | ---------------- |
89-
| GLM-5.1 | 880 | 2,150 | 4,300 |
90-
| GLM-5 | 1,150 | 2,880 | 5,750 |
91-
| Kimi K2.5 | 1,850 | 4,630 | 9,250 |
92-
| Kimi K2.6 | 1,150 | 2,880 | 5,750 |
93-
| MiMo-V2-Pro | 1,290 | 3,225 | 6,450 |
94-
| MiMo-V2-Omni | 2,150 | 5,450 | 10,900 |
95-
| MiMo-V2.5-Pro | 1,290 | 3,225 | 6,450 |
96-
| MiMo-V2.5 | 2,150 | 5,450 | 10,900 |
97-
| Qwen3.6 Plus | 3,300 | 8,200 | 16,300 |
98-
| MiniMax M2.7 | 3,400 | 8,500 | 17,000 |
99-
| MiniMax M2.5 | 6,300 | 15,900 | 31,800 |
100-
| Qwen3.5 Plus | 10,200 | 25,200 | 50,500 |
101-
| DeepSeek V4 Pro | 1,300 | 3,250 | 6,500 |
102-
| DeepSeek V4 Flash | 7,450 | 18,600 | 37,300 |
87+
| Model | الطلبات لكل 5 ساعات | الطلبات في الأسبوع | الطلبات في الشهر |
88+
| ------------------ | ------------------- | ------------------ | ---------------- |
89+
| GLM-5.1 | 880 | 2,150 | 4,300 |
90+
| GLM-5 | 1,150 | 2,880 | 5,750 |
91+
| Kimi K2.5 | 1,850 | 4,630 | 9,250 |
92+
| Kimi K2.6 | 1,150 | 2,880 | 5,750 |
93+
| MiMo-V2-Pro | 1,290 | 3,225 | 6,450 |
94+
| MiMo-V2-Omni | 2,150 | 5,450 | 10,900 |
95+
| MiMo-V2.5-Pro | 1,290 | 3,225 | 6,450 |
96+
| MiMo-V2.5 (≤ 256K) | 2,150 | 5,450 | 10,900 |
97+
| Qwen3.6 Plus | 3,300 | 8,200 | 16,300 |
98+
| MiniMax M2.7 | 3,400 | 8,500 | 17,000 |
99+
| MiniMax M2.5 | 6,300 | 15,900 | 31,800 |
100+
| Qwen3.5 Plus | 10,200 | 25,200 | 50,500 |
101+
| DeepSeek V4 Pro | 1,300 | 3,250 | 6,500 |
102+
| DeepSeek V4 Flash | 7,450 | 18,600 | 37,300 |
103103

104104
تستند التقديرات إلى متوسطات أنماط الطلبات المرصودة:
105105

@@ -155,6 +155,16 @@ OpenCode Go حاليًا في المرحلة التجريبية.
155155

156156
---
157157

158+
### النماذج
159+
160+
يمكنك جلب القائمة الكاملة بالنماذج المتاحة وبياناتها الوصفية من:
161+
162+
```
163+
https://opencode.ai/zen/go/v1/models
164+
```
165+
166+
---
167+
158168
## الخصوصية
159169

160170
صُمّمت هذه الخطة أساسًا للمستخدمين الدوليين، مع استضافة النماذج في الولايات المتحدة والاتحاد الأوروبي وسنغافورة لضمان وصول عالمي مستقر. ويتّبع مزودونا سياسة عدم الاحتفاظ بالبيانات، ولا يستخدمون بياناتك لتدريب النماذج.

packages/web/src/content/docs/ar/zen.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ https://opencode.ai/zen/v1/models
144144
| Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 |
145145
| Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 |
146146
| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 |
147-
| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 |
148147
| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - |
149148
| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - |
150149
| Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - |
@@ -204,15 +203,23 @@ https://opencode.ai/zen/v1/models
204203

205204
### النماذج المهملة
206205

207-
| النموذج | تاريخ الإيقاف |
208-
| ---------------- | ------------- |
209-
| MiniMax M2.1 | 15 مارس 2026 |
210-
| GLM 4.7 | 15 مارس 2026 |
211-
| GLM 4.6 | 15 مارس 2026 |
212-
| Gemini 3 Pro | 9 مارس 2026 |
213-
| Kimi K2 Thinking | 6 مارس 2026 |
214-
| Kimi K2 | 6 مارس 2026 |
215-
| Qwen3 Coder 480B | 6 فبراير 2026 |
206+
| النموذج | تاريخ الإيقاف |
207+
| ------------------ | -------------- |
208+
| GPT 5.2 Codex | 23 يوليو 2026 |
209+
| GPT 5.1 Codex | 23 يوليو 2026 |
210+
| GPT 5.1 Codex Max | 23 يوليو 2026 |
211+
| GPT 5.1 Codex Mini | 23 يوليو 2026 |
212+
| GPT 5 Codex | 23 يوليو 2026 |
213+
| Claude Sonnet 4 | 15 يونيو 2026 |
214+
| GLM 5 | 14 مايو 2026 |
215+
| MiniMax M2.1 | 15 مارس 2026 |
216+
| GLM 4.7 | 15 مارس 2026 |
217+
| GLM 4.6 | 15 مارس 2026 |
218+
| Gemini 3 Pro | 9 مارس 2026 |
219+
| Kimi K2 Thinking | 6 مارس 2026 |
220+
| Kimi K2 | 6 مارس 2026 |
221+
| Claude Haiku 3.5 | 16 فبراير 2026 |
222+
| Qwen3 Coder 480B | 6 فبراير 2026 |
216223

217224
---
218225

packages/web/src/content/docs/bs/go.mdx

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,22 @@ Ograničenja su definisana u dolarskoj vrijednosti. To znači da vaš stvarni br
9494

9595
Tabela ispod pruža procijenjeni broj zahtjeva na osnovu tipičnih obrazaca korištenja Go pretplate:
9696

97-
| Model | zahtjeva na 5 sati | zahtjeva sedmično | zahtjeva mjesečno |
98-
| ----------------- | ------------------ | ----------------- | ----------------- |
99-
| GLM-5.1 | 880 | 2,150 | 4,300 |
100-
| GLM-5 | 1,150 | 2,880 | 5,750 |
101-
| Kimi K2.5 | 1,850 | 4,630 | 9,250 |
102-
| Kimi K2.6 | 1,150 | 2,880 | 5,750 |
103-
| MiMo-V2-Pro | 1,290 | 3,225 | 6,450 |
104-
| MiMo-V2-Omni | 2,150 | 5,450 | 10,900 |
105-
| MiMo-V2.5-Pro | 1,290 | 3,225 | 6,450 |
106-
| MiMo-V2.5 | 2,150 | 5,450 | 10,900 |
107-
| MiniMax M2.7 | 3,400 | 8,500 | 17,000 |
108-
| MiniMax M2.5 | 6,300 | 15,900 | 31,800 |
109-
| Qwen3.6 Plus | 3,300 | 8,200 | 16,300 |
110-
| Qwen3.5 Plus | 10,200 | 25,200 | 50,500 |
111-
| DeepSeek V4 Pro | 1,300 | 3,250 | 6,500 |
112-
| DeepSeek V4 Flash | 7,450 | 18,600 | 37,300 |
97+
| Model | zahtjeva na 5 sati | zahtjeva sedmično | zahtjeva mjesečno |
98+
| ------------------ | ------------------ | ----------------- | ----------------- |
99+
| GLM-5.1 | 880 | 2,150 | 4,300 |
100+
| GLM-5 | 1,150 | 2,880 | 5,750 |
101+
| Kimi K2.5 | 1,850 | 4,630 | 9,250 |
102+
| Kimi K2.6 | 1,150 | 2,880 | 5,750 |
103+
| MiMo-V2-Pro | 1,290 | 3,225 | 6,450 |
104+
| MiMo-V2-Omni | 2,150 | 5,450 | 10,900 |
105+
| MiMo-V2.5-Pro | 1,290 | 3,225 | 6,450 |
106+
| MiMo-V2.5 (≤ 256K) | 2,150 | 5,450 | 10,900 |
107+
| MiniMax M2.7 | 3,400 | 8,500 | 17,000 |
108+
| MiniMax M2.5 | 6,300 | 15,900 | 31,800 |
109+
| Qwen3.6 Plus | 3,300 | 8,200 | 16,300 |
110+
| Qwen3.5 Plus | 10,200 | 25,200 | 50,500 |
111+
| DeepSeek V4 Pro | 1,300 | 3,250 | 6,500 |
112+
| DeepSeek V4 Flash | 7,450 | 18,600 | 37,300 |
113113

114114
Procjene se zasnivaju na zapaženim prosječnim obrascima zahtjeva:
115115

@@ -169,6 +169,16 @@ koristi format `opencode-go/<model-id>`. Na primjer, za Kimi K2.6, koristili bis
169169

170170
---
171171

172+
### Modeli
173+
174+
Pun spisak dostupnih modela i njihovih metapodataka možete preuzeti na:
175+
176+
```
177+
https://opencode.ai/zen/go/v1/models
178+
```
179+
180+
---
181+
172182
## Privatnost
173183

174184
Plan je prvenstveno namijenjen međunarodnim korisnicima, a modeli su smješteni u US, EU i Singaporeu radi stabilnog globalnog pristupa. Naši pružaoci usluga primjenjuju politiku nultog zadržavanja podataka i ne koriste vaše podatke za treniranje modela.

packages/web/src/content/docs/bs/zen.mdx

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ Podržavamo pay-as-you-go model. Ispod su cijene **po 1M tokena**.
151151
| Claude Sonnet 4 (≤ 200K tokens) | $3.00 | $15.00 | $0.30 | $3.75 |
152152
| Claude Sonnet 4 (> 200K tokens) | $6.00 | $22.50 | $0.60 | $7.50 |
153153
| Claude Haiku 4.5 | $1.00 | $5.00 | $0.10 | $1.25 |
154-
| Claude Haiku 3.5 | $0.80 | $4.00 | $0.08 | $1.00 |
155154
| Gemini 3.1 Pro (≤ 200K tokens) | $2.00 | $12.00 | $0.20 | - |
156155
| Gemini 3.1 Pro (> 200K tokens) | $4.00 | $18.00 | $0.40 | - |
157156
| Gemini 3 Flash | $0.50 | $3.00 | $0.05 | - |
@@ -215,15 +214,23 @@ vam ipak može naplatiti više od $20 ako vam stanje padne ispod $5.
215214

216215
### Zastarjeli modeli
217216

218-
| Model | Datum zastarijevanja |
219-
| ---------------- | -------------------- |
220-
| MiniMax M2.1 | March 15, 2026 |
221-
| GLM 4.7 | March 15, 2026 |
222-
| GLM 4.6 | March 15, 2026 |
223-
| Gemini 3 Pro | March 9, 2026 |
224-
| Kimi K2 Thinking | March 6, 2026 |
225-
| Kimi K2 | March 6, 2026 |
226-
| Qwen3 Coder 480B | Feb 6, 2026 |
217+
| Model | Datum zastarijevanja |
218+
| ------------------ | -------------------- |
219+
| GPT 5.2 Codex | July 23, 2026 |
220+
| GPT 5.1 Codex | July 23, 2026 |
221+
| GPT 5.1 Codex Max | July 23, 2026 |
222+
| GPT 5.1 Codex Mini | July 23, 2026 |
223+
| GPT 5 Codex | July 23, 2026 |
224+
| Claude Sonnet 4 | June 15, 2026 |
225+
| GLM 5 | May 14, 2026 |
226+
| MiniMax M2.1 | March 15, 2026 |
227+
| GLM 4.7 | March 15, 2026 |
228+
| GLM 4.6 | March 15, 2026 |
229+
| Gemini 3 Pro | March 9, 2026 |
230+
| Kimi K2 Thinking | March 6, 2026 |
231+
| Kimi K2 | March 6, 2026 |
232+
| Claude Haiku 3.5 | Feb 16, 2026 |
233+
| Qwen3 Coder 480B | Feb 6, 2026 |
227234

228235
---
229236

0 commit comments

Comments
 (0)