mirror of
https://github.com/sst/opencode.git
synced 2025-08-22 14:04:07 +00:00
add chatMaxRetries to config
This commit is contained in:
parent
9bc40f00e3
commit
6cf6bbba9b
2 changed files with 3 additions and 1 deletions
|
@ -307,6 +307,7 @@ export namespace Config {
|
|||
tui: TUI.optional().describe("TUI specific settings"),
|
||||
plugin: z.string().array().optional(),
|
||||
snapshot: z.boolean().optional(),
|
||||
chatMaxRetries: z.number().default(3).optional().describe("Number of retries for chat completions on failure"),
|
||||
share: z
|
||||
.enum(["manual", "auto", "disabled"])
|
||||
.optional()
|
||||
|
|
|
@ -406,6 +406,7 @@ export namespace Session {
|
|||
): Promise<{ info: MessageV2.Assistant; parts: MessageV2.Part[] }> {
|
||||
const l = log.clone().tag("session", input.sessionID)
|
||||
l.info("chatting")
|
||||
const cfg = await Config.get()
|
||||
|
||||
const inputAgent = input.agent ?? "build"
|
||||
|
||||
|
@ -964,7 +965,7 @@ export namespace Session {
|
|||
"x-opencode-request": userMsg.id,
|
||||
}
|
||||
: undefined,
|
||||
maxRetries: 3,
|
||||
maxRetries: cfg.chatMaxRetries,
|
||||
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
|
||||
maxOutputTokens: outputLimit,
|
||||
abortSignal: abort.signal,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue