fix(config): remove duplicate annotate on provider timeout/chunkTimeout (F1)#4
fix(config): remove duplicate annotate on provider timeout/chunkTimeout (F1)#4tesdal wants to merge 1 commit intophase-ab-basefrom
Conversation
…Timeout The inner Union schema already carried the description. The outer Schema.optional annotation re-applied it, producing duplicate entries in SDK codegen output. Collapses to a single annotation. Regression test: test/config/provider-schema.test.ts asserts each description substring appears exactly once in the schema AST. Addresses audit finding F1 (Opus diamond review, 2026-04-22).
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
There was a problem hiding this comment.
Pull request overview
Remediates audit finding F1 by removing duplicate description annotations on ConfigProvider.Info’s timeout and chunkTimeout fields, and adds regression tests to ensure the schema AST contains each description exactly once.
Changes:
- Remove redundant outer
.annotate({ description: ... })wrappers fortimeoutandchunkTimeoutinConfigProvider.Info. - Add Bun tests that serialize
ConfigProvider.Info.astand assert the relevant description strings occur exactly once.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/opencode/src/config/provider.ts | Drops duplicate .annotate(...) on timeout and chunkTimeout fields to avoid double annotation in the schema AST. |
| packages/opencode/test/config/provider-schema.test.ts | Adds AST-based regression tests to prevent reintroducing duplicate description annotations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Copilot review: no comments. All three reviewers (codex-5.3 spec 9/11, Opus quality APPROVE, Copilot clean) agree. Merging --no-ff into local/integration-v2. PR closed as review-only. |
Summary
Audit finding F1 from 2026-04-22 diamond audit:
ConfigProvider.Infoschema double-annotatestimeoutandchunkTimeout. InnerSchema.Int.pipe(Schema.greaterThanOrEqualTo(0)).annotations({ description, default })already attaches description + default; outer.annotations({...})wrapper overwrites with identical values. Pure duplication.Changes
packages/opencode/src/config/provider.ts— drop outer.annotations()on both fields. Inner description preserved character-for-character.packages/opencode/test/config/provider-schema.test.ts— new, 2 AST-based tests that serializeConfigProvider.Info.astand assert each description appears exactly once. Fail before fix, pass after (verified by reviewer reverting + reapplying).Verification
bun typecheck— cleanbun test test/config/provider-schema.test.ts— 2/2 passbun test test/session/subagent-hang-regression.test.ts— 2/2 pass (unaffected)./packages/sdk/js/script/build.ts) — zero diff totypes.gen.ts, codegen dedupes at HTTP layer. Fix is still valid at AST level.Diamond review status
ConfigProvider.Info.astdirectly vs.Schema.asSchema(...)— functionally equivalent).Context
Part of 14-task audit remediation plan (
docs/superpowers/plans/2026-04-23-audit-remediation.md). Basephase-ab-basenow tracksb2cc4ac8d(local/integration-v2 HEAD). Draft PR opened for Copilot review only — merge target is local integration branch, not upstream.