Repository navigation
test(opencode-go): consolidate stream termination harness - #118317
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 2, 2026, 8:12 PM ET / August 3, 2026, 00:12 UTC. ClawSweeper reviewWhat this changesThis PR consolidates repeated OpenCode Go stalled-stream test setup and async stream draining into local helpers in Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain Keep this PR open for protected maintainer review. Source review found no blocking correctness defect: the new file-local harness preserves the 12 test titles and 43 matcher calls while leaving the production stream wrapper untouched; however, the external-PR proof gate is not met and live GitHub metadata could not be refreshed. Priority: P3 Review scores
Verification
How this fits togetherThe OpenCode Go provider wraps raw OpenAI-compatible SSE streams so provider-scoped first-event and idle timeouts abort stalled requests and emit a terminal error. The changed suite supplies scripted stream events to that wrapper and checks cancellation, timeout precedence, completion, and iterator release. flowchart LR
A[OpenAI-compatible provider stream] --> B[OpenCode Go stream wrapper]
B --> C[First-event and idle timers]
C --> D[Abort or terminal event]
D --> E[Downstream consumer]
F[Scripted regression events] --> G[File-local test harness]
G --> B
G --> E
Decision needed
Why: The protected Before merge
Agent review detailsSecurityNone. PR surfaceTests -233. Total -233 across 1 file. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the fixture abstraction file-local, attach redacted exact-head focused-test proof, and let a maintainer review it once the active checks finish. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors existing regression-test plumbing rather than reporting a separate user-facing failure. Source comparison establishes that the production timeout and abort path is unchanged. Is this the best way to solve the issue? Yes, subject to exact-head proof: a file-local harness is the narrowest maintainable place to remove duplicated fixture lifecycle setup, and it leaves the provider-owned runtime wrapper unchanged. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 51548dd7e1a0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
Summary
Root cause and owner boundary
The suite repeated the same fake stream, wrapped provider, abort observer, and async consumer setup across every timeout regression. That duplicated lifecycle policy in test plumbing and made neighboring cases easier to drift.
The canonical fix stays local to
extensions/opencode-go/stream-termination.test.ts: one harness owns only fixture construction and one helper drains anAsyncIterable. The production owner remainsextensions/opencode-go/stream-termination.ts; registration and wrapper ordering inextensions/opencode-go/index.tsandextensions/opencode-go/stream.tsare unchanged. No compatibility path, fallback, production abstraction, config, schema, or dependency changed.Parity
Validation
extensions/opencode-go/stream-termination.test.ts— 12/12 passedpnpm test extensions/opencode-go— 38/38 passed across 5 filesgit diff --check: passedDependency contract proof
OpenAI SDK 6.49.0 source confirms request
AbortSignalforwarding and stream reader cancellation on iterator exit innode_modules/openai/src/client.ts,node_modules/openai/src/core/streaming.ts, andnode_modules/openai/src/internal/stream-utils.ts.The sibling Codex checkout was inspected directly at
ee0247f95a6fe2b094ba2253d82cae2a2b4c2dff: provider timeout defaults in../codex/codex-rs/model-provider-info/src/lib.rs; auth snapshot/refresh ownership in../codex/codex-rs/login/src/auth/manager.rs; provider/auth session wiring in../codex/codex-rs/core/src/thread_manager.rsand../codex/codex-rs/core/src/session/session.rs; SSE timeout/terminal behavior in../codex/codex-rs/codex-client/src/sse.rsand../codex/codex-rs/codex-api/src/sse/responses.rs. No contract conflict was found.LOC