Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 2 additions & 8 deletions packages/opencode/src/config/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,13 @@ export const Info = Schema.Struct({
description:
"Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
}),
).annotate({
description:
"Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
}),
),
chunkTimeout: Schema.optional(
Schema.Union([PositiveInt, Schema.Literal(false)]).annotate({
description:
"Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted. Defaults to 120000 (120s) for most providers, 600000 (10min) for Anthropic-family providers (to accommodate extended thinking). Set to false to disable.",
}),
).annotate({
description:
"Timeout in milliseconds between streamed SSE chunks for this provider. If no chunk arrives within this window, the request is aborted. Defaults to 120000 (120s) for most providers, 600000 (10min) for Anthropic-family providers (to accommodate extended thinking). Set to false to disable.",
}),
),
}),
[Schema.Record(Schema.String, Schema.Any)],
),
Expand Down
18 changes: 18 additions & 0 deletions packages/opencode/test/config/provider-schema.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, expect, test } from "bun:test"
import { ConfigProvider } from "../../src/config/provider"

describe("ConfigProvider schema", () => {
test("chunkTimeout has exactly one description annotation", () => {
const json = JSON.stringify(ConfigProvider.Info.ast)
const needle = "Timeout in milliseconds between streamed SSE chunks"
const count = json.split(needle).length - 1
expect(count).toBe(1)
})

test("timeout has exactly one description annotation", () => {
const json = JSON.stringify(ConfigProvider.Info.ast)
const needle = "Timeout in milliseconds for requests to this provider"
const count = json.split(needle).length - 1
expect(count).toBe(1)
})
})
Loading