Skip to content

Commit 2309cc8

Browse files
committed
Merge F1: remove duplicate annotate on ConfigProvider timeout/chunkTimeout
Diamond review: codex-5.3 spec 9/11 (minor deviations accepted), Opus quality APPROVE, Copilot clean. Closes audit finding F1. Copilot review PR #4 (closed as review-only).
2 parents b2cc4ac + 74aa8dd commit 2309cc8

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

packages/opencode/src/config/provider.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,19 +94,13 @@ export const Info = Schema.Struct({
9494
description:
9595
"Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
9696
}),
97-
).annotate({
98-
description:
99-
"Timeout in milliseconds for requests to this provider. Default is 300000 (5 minutes). Set to false to disable timeout.",
100-
}),
97+
),
10198
chunkTimeout: Schema.optional(
10299
Schema.Union([PositiveInt, Schema.Literal(false)]).annotate({
103100
description:
104101
"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.",
105102
}),
106-
).annotate({
107-
description:
108-
"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.",
109-
}),
103+
),
110104
}),
111105
[Schema.Record(Schema.String, Schema.Any)],
112106
),
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { describe, expect, test } from "bun:test"
2+
import { ConfigProvider } from "../../src/config/provider"
3+
4+
describe("ConfigProvider schema", () => {
5+
test("chunkTimeout has exactly one description annotation", () => {
6+
const json = JSON.stringify(ConfigProvider.Info.ast)
7+
const needle = "Timeout in milliseconds between streamed SSE chunks"
8+
const count = json.split(needle).length - 1
9+
expect(count).toBe(1)
10+
})
11+
12+
test("timeout has exactly one description annotation", () => {
13+
const json = JSON.stringify(ConfigProvider.Info.ast)
14+
const needle = "Timeout in milliseconds for requests to this provider"
15+
const count = json.split(needle).length - 1
16+
expect(count).toBe(1)
17+
})
18+
})

0 commit comments

Comments
 (0)