Dashboard › opencode › Distillation
6c9d3331-8807-4ca6-8db2-4b6fe82bf84a["lore_tm_v1_5U4nge-KJPrBYZHIFAc9UHTz2MXtPeE6yyWonpNIIUc","lore_tm_v1_Q1cRSCUyytA6j-l8MfvRfZxLVCrPdMBfXl0P3BP9s2Y","lore_tm_v1_yPLPuJhjTBclyIfftnjKRn7KQidAq43_Fcv2qzzmXfs","lore_tm_v1_dfN9f7pKulPMjAFbrhSck5u4SvBMOZrXMGsgethfTFI","lore_tm_v1_jXHZyeNV8hAuOPVlDhSJ31z0rTDxJxGhw6DPVTozs3Q","lore_tm_v1_eJpY0b5EyhHRfJhXaWxzmaRDIUYWa3D3xj5Y_Y668jw","lore_tm_v1_-rk7x8nMn7WstReCi40WXWtNj7kq_8dmxKzPxCEPKug"]
Date: Sep 9, 2026
/home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts lines 471-481 still pass their headers to observeRequestHeaders() so in-process extensions can scope side-channel requests, then call the original fetch./home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts lines 484-493 bypass hosts localhost, 127.0.0.1, 0.0.0.0, ::1, and [::1]./home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts’s installFetchInterceptor(config) uses a process-shared original-fetch slot to prevent double installation across multiple copies of the module; if the slot is non-null, it returns a no-op cleanup to avoid interceptor-chain corruption and the infinite-loop shape guarded by issue #1027.installFetchInterceptor() stores globalThis.fetch, pre-parses config.gatewayBase, and fast-bypasses URL parsing unless the URL contains /messages, /completions, or /responses; malformed URLs also use the original fetch./home/byk/Code/opencode-lore/packages/core/src/fetch-interceptor.ts warns only once per ${upstream.host}${upstream.pathname} via warnedPaths, then bypasses the Lore gateway.installFetchInterceptor() preserves extra properties from the original fetch, such as newer Node.js preconnect, by assigning globalThis.fetch = Object.assign(interceptor, originalFetch); cleanup restores originalFetch and clears the shared slot with writeOriginalFetchSlot(null)./home/byk/Code/opencode-lore/packages/gateway/src/portfile.ts stores runtime gateway discovery data in ~/.local/share/lore/gateway.port; clean shutdown removes it, while stale crash artifacts are harmless because plugins probe /health and ignore unresponsive ports.GatewayPortRecord has exact fields version: 1, port: number, and token: string; valid ports are safe integers from 1 through 65535, and valid tokens have lengths from 32 through 256.writePortFile(port, token?) supports a legacy plain-port format when token === undefined; with a token it validates both fields and atomically writes ${JSON.stringify({ version: 1, port, token })}\n, throwing Invalid gateway port record for invalid data.removePortFile(expectedPort, expectedToken?) atomically claims gateway.port by renaming it to .gateway.port.cleanup-${process.pid}-${randomBytes(8).toString("hex")}; it deletes only a matching generation, supports matching legacy plain-port records when no token is expected, and otherwise attempts to restore the displaced record with linkSync(). If restoration encounters EEXIST, it retains the displaced unknown generation as a recovery artifact.readPortFile() accepts either valid versioned JSON or a valid legacy integer port and returns null on invalid or unreadable data; strict inspectPortFile(runtimeName = PORTFILE_NAME) instead distinguishes { state: "absent" }, { state: "valid", record }, and { state: "invalid", reason }, reading with { ownerOnly: true }./home/byk/Code/opencode-lore/packages/gateway/test/shutdown-active-stream.test.ts verifies that authenticated shutdown remains bounded when a socket sends incomplete HTTP headers: the test uses shutdownDeadlineMs: 75, calls requestGatewayShutdown(record, 500), expects "accepted", requires shutdown settlement within 500 ms, confirms the socket is destroyed and the process record removed, and confirms handle.shutdown() resolves.{ port: 0, local: true, quiet: true, processBoundary: true }, uses both server and process-controller deadlines of 20 ms, blocks resetPipelineState, and expects forced exit code 1; forcedExit(1) runs, safeExit does not run, and reset is invoked exactly once.processRecord must still equal the original record rather than being removed./home/byk/Code/opencode-lore/packages/gateway/test/shutdown-active-stream.test.ts asserts that a concurrent signal/control shutdown request shares the existing teardown attempt: handle.processShutdown?.(143) must not cause resetPipelineState to run more than once.