Dashboard › opencode › Distillation
3cdc2061-5311-45e5-9e5a-584f7141a41f["lore_tm_v1_587DU99FF5aM91ut1XQ5f6Soa0toGY9bz-ik16Yim1Q"]
Date: Sep 8, 2026
HttpClient replacement never reaches the default FetchHttpClient.Fetch refusal mechanism in /home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:6-8 defines Body<A, E, R> as either an Effect.Effect<A, E, R> or a zero-argument function returning one; body(...) uses Effect.suspend(...) to defer evaluating either form./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:10-29 defines loopback hosts as exactly "127.0.0.1", "localhost", and "[::1]". refuseNetwork(violations) permits requests to those hosts through the original fetch, but rejects every other request with Error("test attempted network request: ${method} ${url} — provide an explicit HttpClient or disable the fetch"), records the message in violations, defaults the method to "GET", and preserves fetch.preconnect./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:12-17 is that core is environment-free, so a test booting the default node graph could make outbound calls through FetchHttpClient; all default clients read the supplied fetch reference at request time, while explicit HttpClient replacements bypass it. Because callers such as ModelsDev may swallow request failures, the harness separately records attempts and fails the test./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:31-47 defines run(...): it initializes violations, evaluates the body with Effect.scoped, provides the selected layer and FetchHttpClient.Fetch via refuseNetwork(violations), captures Effect.exit, logs every Cause.prettyErrors(exit.cause) entry on failure, fails with all violation messages joined by "\n" when any forbidden request occurred, otherwise returns the captured exit, and finally uses Effect.runPromise./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:49-68 defines make(testLayer, liveLayer), returning { effect, live }. Both wrappers register Bun tests through test(...); each also exposes .only through test.only(...) and .skip through test.skip(...), accepts opts?: number | TestOptions, and invokes run(value, testLayer) or run(value, liveLayer) respectively./home/byk/Code/opencode-v2-pilot/packages/core/test/lib/effect.ts:71-80 defines testEnv = Layer.mergeAll(TestConsole.layer, TestClock.layer()) and liveEnv = TestConsole.layer, so the test environment uses a test clock and captured console while the live environment uses the real clock with captured console. It exports it = make(testEnv, liveEnv) and testEffect(layer) = make(Layer.provideMerge(layer, testEnv), Layer.provideMerge(layer, liveEnv)).