Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
6cf6bbb
add chatMaxRetries to config
dfavato Aug 20, 2025
231c9f3
move to experimental
dfavato Aug 22, 2025
32191be
Merge remote-tracking branch 'origin/dev' into dev
dfavato Sep 24, 2025
89ffad4
chore: format code
actions-user Sep 24, 2025
ac1c3fe
ignore: update download stats 2025-09-25
actions-user Sep 25, 2025
ddb3c2c
ignore: update download stats 2025-09-26
actions-user Sep 26, 2025
f3126d0
ignore: update download stats 2025-09-27
actions-user Sep 27, 2025
62b7281
ignore: update download stats 2025-09-28
actions-user Sep 28, 2025
e221b60
ignore: update download stats 2025-09-29
actions-user Sep 29, 2025
742c2f2
ignore: update download stats 2025-09-30
actions-user Sep 30, 2025
36da32f
ignore: update download stats 2025-10-01
actions-user Oct 1, 2025
b2373e2
ignore: update download stats 2025-10-02
actions-user Oct 2, 2025
bb43ea7
ignore: update download stats 2025-10-03
actions-user Oct 3, 2025
6d69e96
ignore: update download stats 2025-10-04
actions-user Oct 4, 2025
7d22edf
ignore: update download stats 2025-10-05
actions-user Oct 5, 2025
eeb0a79
ignore: update download stats 2025-10-07
actions-user Oct 7, 2025
76ea20b
ignore: update download stats 2025-10-08
actions-user Oct 8, 2025
ee099f3
ignore: update download stats 2025-10-09
actions-user Oct 9, 2025
86eee23
ignore: update download stats 2025-10-10
actions-user Oct 10, 2025
a833808
ignore: update download stats 2025-10-11
actions-user Oct 11, 2025
d4b211a
ignore: update download stats 2025-10-12
actions-user Oct 12, 2025
a1dc438
ignore: update download stats 2025-10-13
actions-user Oct 13, 2025
e6bfc05
ignore: update download stats 2025-10-14
actions-user Oct 14, 2025
8a7bedc
ignore: update download stats 2025-10-15
actions-user Oct 15, 2025
6b1088a
ignore: update download stats 2025-10-16
actions-user Oct 16, 2025
2d9b98c
ignore: update download stats 2025-10-17
actions-user Oct 17, 2025
def5663
ignore: update download stats 2025-10-18
actions-user Oct 18, 2025
bd5a697
ignore: update download stats 2025-10-19
actions-user Oct 19, 2025
47ffec0
ignore: update download stats 2025-10-20
actions-user Oct 20, 2025
f27dfd8
ignore: update download stats 2025-10-21
actions-user Oct 21, 2025
25f7ebb
ignore: update download stats 2025-10-22
actions-user Oct 22, 2025
f85f1b2
ignore: update download stats 2025-10-23
actions-user Oct 23, 2025
40b9fcd
ignore: update download stats 2025-10-24
actions-user Oct 24, 2025
16dcd5b
ignore: update download stats 2025-10-25
actions-user Oct 25, 2025
eb8ab2b
ignore: update download stats 2025-10-26
actions-user Oct 26, 2025
02e70d6
ignore: update download stats 2025-10-27
actions-user Oct 27, 2025
49d131e
ignore: update download stats 2025-10-28
actions-user Oct 28, 2025
248269c
Merge dev branch - accept all dev changes
rekram1-node Oct 28, 2025
44bb207
fix conflicts
rekram1-node Oct 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/opencode/src/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,7 @@ export namespace Config {
.optional(),
})
.optional(),
chatMaxRetries: z.number().optional().describe("Number of retries for chat completions on failure"),
disable_paste_summary: z.boolean().optional(),
})
.optional(),
Expand Down
9 changes: 6 additions & 3 deletions packages/opencode/src/session/compaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { Log } from "../util/log"
import { SessionLock } from "./lock"
import { ProviderTransform } from "@/provider/transform"
import { SessionRetry } from "./retry"
import { Config } from "@/config/config"

export namespace SessionCompaction {
const log = Log.create({ service: "session.compaction" })
Expand Down Expand Up @@ -258,12 +259,14 @@ export namespace SessionCompaction {
}

let stream = doStream()
const cfg = await Config.get()
const maxRetries = cfg.experimental?.chatMaxRetries ?? MAX_RETRIES
let result = await process(stream, {
count: 0,
max: MAX_RETRIES,
max: maxRetries,
})
if (result.shouldRetry) {
for (let retry = 1; retry < MAX_RETRIES; retry++) {
for (let retry = 1; retry < maxRetries; retry++) {
const lastRetryPart = result.parts.findLast((p) => p.type === "retry")

if (lastRetryPart) {
Expand Down Expand Up @@ -300,7 +303,7 @@ export namespace SessionCompaction {
stream = doStream()
result = await process(stream, {
count: retry,
max: MAX_RETRIES,
max: maxRetries,
})
if (!result.shouldRetry) {
break
Expand Down
9 changes: 6 additions & 3 deletions packages/opencode/src/session/prompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { Command } from "../command"
import { $, fileURLToPath } from "bun"
import { ConfigMarkdown } from "../config/markdown"
import { SessionSummary } from "./summary"
import { Config } from "@/config/config"

export namespace SessionPrompt {
const log = Log.create({ service: "session.prompt" })
Expand Down Expand Up @@ -330,12 +331,14 @@ export namespace SessionPrompt {
})

let stream = doStream()
const cfg = await Config.get()
const maxRetries = cfg.experimental?.chatMaxRetries ?? MAX_RETRIES
let result = await processor.process(stream, {
count: 0,
max: MAX_RETRIES,
max: maxRetries,
})
if (result.shouldRetry) {
for (let retry = 1; retry < MAX_RETRIES; retry++) {
for (let retry = 1; retry < maxRetries; retry++) {
const lastRetryPart = result.parts.findLast((p) => p.type === "retry")

if (lastRetryPart) {
Expand Down Expand Up @@ -372,7 +375,7 @@ export namespace SessionPrompt {
stream = doStream()
result = await processor.process(stream, {
count: retry,
max: MAX_RETRIES,
max: maxRetries,
})
if (!result.shouldRetry) {
break
Expand Down