Adapt fork tests + run.ts to 1.17.14 APIs
Merged
KE
3mo ago+124+124+012345678901234567890123456789-139-139-012345678901234567890123456789
Small adaptations of fork-owned code and tests to APIs that changed upstream between 1.17.9 and 1.17.14. Stacked on #16 (merge of upstream v1.17.14); auto-retargets to dev when #16 lands. 7 files, +34/ā47.
- Tests ā LayerNode composition: upstream replaced per-module
defaultLayer/layerexports with the LayerNode graph; fork tests now compose viaLayerNode.compile/group+AppNodeBuilder.build, mirroring upstream siblings (skill.test.ts,plugin/trigger.test.ts). Grouping[X.node, Config.node]in one compile preserves the shared-Config-singleton semantics the reload tests assert. - refresh-headers test rebuilt mock-free: bun's
mock.moduleis process-global and permanent, so mocking the MCP SDK here leaked fake transports into 26 other MCP tests in the shared suite process (the first CI run's failures). Now uses the same real streamable-HTTP server harness asheaders.test.tsand asserts the rotatedAuthorizationlands on the wire over the SAME transport ā a stronger check than the old mock-object inspection. Theharness-reloadMCP stub separately gains the newinstructions/resourceTemplatesinterface members. run.ts: upstream's new CLI call site usedFilesystem.stat, which our REPL-28760 event-loop patch renamed tostatSync; adapted (one-shot CLI arg-validation path, sync is fine).
Testing Done
Tip tree is byte-identical to the branch that ran the full verification suite (see #16): typecheck + 176 targeted tests green under pinned bun 1.3.14, release build verified, production-sandbox soak + A/B.
š¤ Generated with Claude Code
Summary by cubic
Adapted tests and CLI to upstream 1.17.14 APIs. Reload tests now use LayerNode + AppNodeBuilder with a shared Config, and the MCP refresh-headers test uses a real @modelcontextprotocol/sdk server to prove on-wire header rotation without reconnects.
-
Refactors
- Migrated reload tests to
LayerNode.compile/group+AppNodeBuilder.build(group[X.node, Config.node]) to mirror upstream and preserve the sharedConfigsingleton across plugin/skill/instance-store/harness tests. - Rewrote
packages/opencode/test/mcp/refresh-headers.test.tsto use a real@modelcontextprotocol/sdkServer+WebStandardStreamableHTTPServerTransport, capture request headers, assert rotated Authorization on the same transport, and confirm no eager MCP connection when unused. - Updated harness MCP stubs to include
instructionsandresourceTemplates.
- Migrated reload tests to
-
Bug Fixes
- Replaced
Filesystem.statwithFilesystem.statSyncinpackages/opencode/src/cli/cmd/run.tsfor one-shot CLI validation. - Dropped process-global MCP SDK mocks from refresh-headers to prevent leakage into other tests.
- Increased time budget in
packages/opencode/test/cli/run/run-process.test.tsfor the unknown-model fast-fail guard to reduce CI flakiness (timeout 30s, harness 60s).
- Replaced