GeezerVison is showing github.com — gpt-5 lower verbosity · daonb/opencode@53630eb
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: bun.lock +27-288Lines changed: 27 additions & 288 deletions Collapse file Copy file name to clipboardExpand all lines: package.json +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 20 | 20 | "@hono/zod-validator": "0.4.2", | 21 | 21 | "@types/node": "22.13.9", | 22 | 22 | "@tsconfig/node22": "22.0.2", | 23 | | - "ai": "5.0.0-beta.34", | | 23 | + "ai": "5.0.8", | 24 | 24 | "hono": "4.7.10", | 25 | 25 | "typescript": "5.8.2", | 26 | | - "zod": "3.25.49", | | 26 | + "zod": "3.25.76", | 27 | 27 | "remeda": "2.26.0" | 28 | 28 | } | 29 | 29 | }, | |
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 = "4" | | 30 | +const CACHE_VERSION = "5" | 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/provider/provider.ts +15-15Lines changed: 15 additions & 15 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -97,7 +97,7 @@ export namespace Provider { | 97 | 97 | Array.isArray(msg.content) && msg.content.some((part: any) => part.type === "image_url"), | 98 | 98 | ) | 99 | 99 | } | 100 | | - } catch { } | | 100 | + } catch {} | 101 | 101 | const headers: Record<string, string> = { | 102 | 102 | ...init.headers, | 103 | 103 | ...copilot.HEADERS, | @@ -283,26 +283,26 @@ export namespace Provider { | 283 | 283 | cost: | 284 | 284 | !model.cost && !existing?.cost | 285 | 285 | ? { | 286 | | - input: 0, | 287 | | - output: 0, | 288 | | - cache_read: 0, | 289 | | - cache_write: 0, | 290 | | - } | | 286 | + input: 0, | | 287 | + output: 0, | | 288 | + cache_read: 0, | | 289 | + cache_write: 0, | | 290 | + } | 291 | 291 | : { | 292 | | - cache_read: 0, | 293 | | - cache_write: 0, | 294 | | - ...existing?.cost, | 295 | | - ...model.cost, | 296 | | - }, | | 292 | + cache_read: 0, | | 293 | + cache_write: 0, | | 294 | + ...existing?.cost, | | 295 | + ...model.cost, | | 296 | + }, | 297 | 297 | options: { | 298 | 298 | ...existing?.options, | 299 | 299 | ...model.options, | 300 | 300 | }, | 301 | 301 | limit: model.limit ?? | 302 | 302 | existing?.limit ?? { | 303 | | - context: 0, | 304 | | - output: 0, | 305 | | - }, | | 303 | + context: 0, | | 304 | + output: 0, | | 305 | + }, | 306 | 306 | } | 307 | 307 | parsed.models[modelID] = parsedModel | 308 | 308 | } | @@ -373,7 +373,7 @@ export namespace Provider { | 373 | 373 | const existing = s.sdk.get(provider.id) | 374 | 374 | if (existing) return existing | 375 | 375 | const pkg = provider.npm ?? provider.id | 376 | | - const mod = await import(await BunProc.install(pkg, "beta")) | | 376 | + const mod = await import(await BunProc.install(pkg, "latest")) | 377 | 377 | const fn = mod[Object.keys(mod).find((key) => key.startsWith("create"))!] | 378 | 378 | const loaded = fn({ | 379 | 379 | name: provider.id, | |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/provider/transform.ts +9Lines changed: 9 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -81,4 +81,13 @@ export namespace ProviderTransform { | 81 | 81 | if (modelID.toLowerCase().includes("qwen")) return 1 | 82 | 82 | return undefined | 83 | 83 | } | | 84 | + | | 85 | + export function options(_providerID: string, modelID: string) { | | 86 | + if (modelID.includes("gpt-5")) { | | 87 | + return { | | 88 | + reasoningEffort: "low", | | 89 | + textVerbosity: "low", | | 90 | + } | | 91 | + } | | 92 | + } | 84 | 93 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/opencode/src/session/index.ts +14-9Lines changed: 14 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -322,9 +322,9 @@ export namespace Session { | 322 | 322 | for (const child of await children(sessionID)) { | 323 | 323 | await remove(child.id, false) | 324 | 324 | } | 325 | | - await unshare(sessionID).catch(() => { }) | 326 | | - await Storage.remove(`session/info/${sessionID}`).catch(() => { }) | 327 | | - await Storage.removeDir(`session/message/${sessionID}/`).catch(() => { }) | | 325 | + await unshare(sessionID).catch(() => {}) | | 326 | + await Storage.remove(`session/info/${sessionID}`).catch(() => {}) | | 327 | + await Storage.removeDir(`session/message/${sessionID}/`).catch(() => {}) | 328 | 328 | state().sessions.delete(sessionID) | 329 | 329 | state().messages.delete(sessionID) | 330 | 330 | if (emitEvent) { | @@ -523,7 +523,7 @@ export namespace Session { | 523 | 523 | sessionID: input.sessionID, | 524 | 524 | abort: new AbortController().signal, | 525 | 525 | messageID: userMsg.id, | 526 | | - metadata: async () => { }, | | 526 | + metadata: async () => {}, | 527 | 527 | }), | 528 | 528 | ) | 529 | 529 | return [ | @@ -632,7 +632,7 @@ export namespace Session { | 632 | 632 |
| 633 | 633 | // mark session as updated | 634 | 634 | // used for session list sorting (indicates when session was most recently interacted with) | 635 | | - await update(input.sessionID, (_draft) => { }) | | 635 | + await update(input.sessionID, (_draft) => {}) | 636 | 636 |
| 637 | 637 | if (isLocked(input.sessionID)) { | 638 | 638 | return new Promise((resolve) => { | @@ -679,7 +679,9 @@ export namespace Session { | 679 | 679 | generateText({ | 680 | 680 | maxOutputTokens: small.info.reasoning ? 1024 : 20, | 681 | 681 | providerOptions: { | 682 | | - [input.providerID]: small.info.options, | | 682 | + [input.providerID]: { | | 683 | + ...small.info.options, | | 684 | + }, | 683 | 685 | }, | 684 | 686 | messages: [ | 685 | 687 | ...SystemPrompt.title(input.providerID).map( | @@ -712,7 +714,7 @@ export namespace Session { | 712 | 714 | draft.title = title.trim() | 713 | 715 | }) | 714 | 716 | }) | 715 | | - .catch(() => { }) | | 717 | + .catch(() => {}) | 716 | 718 | } | 717 | 719 |
| 718 | 720 | const agent = await Agent.get(inputAgent) | @@ -927,11 +929,14 @@ export namespace Session { | 927 | 929 | }, | 928 | 930 | maxRetries: 3, | 929 | 931 | activeTools: Object.keys(tools).filter((x) => x !== "invalid"), | 930 | | - maxOutputTokens: model.info.id.startsWith("gpt-5") ? undefined : outputLimit, | | 932 | + maxOutputTokens: outputLimit, | 931 | 933 | abortSignal: abort.signal, | 932 | 934 | stopWhen: stepCountIs(1000), | 933 | 935 | providerOptions: { | 934 | | - [input.providerID]: model.info.options, | | 936 | + [input.providerID]: { | | 937 | + ...ProviderTransform.options(input.providerID, input.modelID), | | 938 | + ...model.info.options, | | 939 | + }, | 935 | 940 | }, | 936 | 941 | temperature: params.temperature, | 937 | 942 | topP: params.topP, | |
|