Dashboard › opencode › Distillation
537e0e4f-6aa7-4b55-9587-3586932d3a2b["lore_tm_v1_5U8vigScblEOKIpRgbwhUiKc98RzNtYFxo7anFmAN20","lore_tm_v1_NId5UmnT-aEPqNNz376Zi1cIJ6kDitffv1MnsU5Rrnw","lore_tm_v1_OMfN2xag1PCIWeJzwXH_eSHX2e75RuuXzgB8c4O2218","lore_tm_v1_wLC_yyNBAbgKBNHA2IP8Z4N4nrBFUeDUdXZ3XO_mrw8","lore_tm_v1_Gd_yk4cI1eg3fzLNyr-4UKQbIWnlDymgYgVz0pcPhws","lore_tm_v1_uhpB-YQc_6UBuKgE-djGcPpWCEz1Kt16E58obaTOW38","lore_tm_v1_WpSaOFcQSbOZ9K3gUm0EjcD9-zhfaBAEhCQfCNuuUB8","lore_tm_v1_yE0oF02JQ4fF-sO0TMVunetTJv_fljK4WdcSHsPnzho","lore_tm_v1_yzIrcQUMhNTHiunN8KPb1Vq5aP9Iyumy_41iwj_5wXo","lore_tm_v1_B0q-uyPinuJ8ZclJlhs5Sobo83-iTrLL0foT7R9luRQ","lore_tm_v1_wH6IbB2ow3XTRT7HrCqIvQ-Jtd5ovkrkVXfrlnqXkIg","lore_tm_v1_rGSWfvyaov_y_BuBdnfWnBzrQSqAgB5hKnptl-1XnSw","lore_tm_v1_xUVr4RrUIqhpLEaLZ2kdJ2wur8cNlVh9qZn-D3vbjmE","lore_tm_v1_lBL8f_2THTnCy56qSr2cZlYQuWQ3VYFg2popgZHmdrQ","lore_tm_v1_h6vfL059xwpRblGzbZ63B7RENWykyh0OEz00sMtPnKU","lore_tm_v1_ww2Wv5pL50vSI0nfQV7HOAvwiPdz3XFchcvrOgk5ql8"]
Date: Sep 9, 2026
No files found.after input 0 false, after output 0 false true, and microtask 1 false.after output 0 false true and microtask 1 false.before false false, after true true false, and microtask true true.Request.body; never clone or read an unknown stream merely to detect its body shape. The installer may retain synchronous body hints for string and buffer RequestInit bodies./home/byk/Code/opencode-lore-v2/packages/core/test/fetch-interceptor-request.test.ts./home/byk/Code/opencode-lore-v2/packages/core with filter test/fetch-interceptor-request.test.ts found no tests and exited with code 1; repository configuration includes packages/core/test/**/*.test.ts, packages/core/eval/**/*.test.ts, packages/gateway/test/**/*.test.ts, packages/opencode/test/**/*.test.ts, packages/pi/test/**/*.test.ts, and excludes **/node_modules/**, **/.git/**.--root ../.. and the repository-relative test path./home/byk/Code/opencode-lore-v2 executed packages/core/test/fetch-interceptor-request.test.ts: exactly 10 tests ran and all 10 failed in 47ms; result was 1 failed test file, start time 10:12:02, total duration 1.02s (transform 633ms, setup 682ms, import 31ms, tests 47ms, environment 0ms).rewriteRequest was not implemented/exported: TypeError: rewriteRequest is not a function.rewriteRequest tests, in order, were: 1. route a V2-style Request without losing method, body, auth, path, or query; 2. preserve a caller-set dynamic header; 3. return a direct gateway Request unchanged while observing its headers; 4. return http://localhost:8000/v1/messages unchanged; 5. return http://127.0.0.1:8000/v1/messages unchanged; 6. return http://0.0.0.0:8000/v1/messages unchanged; 7. return http://[::1]:8000/v1/messages unchanged; 8. return a non-LLM request unchanged; 9. route a streaming body on a known path without reading it; 10. neither read nor route a streaming body on an unknown path.POST https://openrouter.ai/api/v1/chat/completions?stream=true&trace=abc, body {"model":"gpt-5","messages":[{"role":"user","content":"Hello"}]}, authorization: Bearer sk-test, content-type: application/json, and x-api-key: api-key-test; expected routing is https://gateway.example.com/v1/chat/completions?stream=true&trace=abc with upstream base https://openrouter.ai/api, upstream path /api/v1/chat/completions, original method/body/auth/query preserved, and header observer called once with routed headers."x-lore-project": "/home/me/project" and "x-lore-session-id": "session-123"; an existing request header "x-lore-session-id": "request-session" must take precedence over the dynamic value.POST to https://gateway.example.com/v1/messages with authorization: Bearer direct must return the identical Request, must not inject x-lore-project, and must invoke the observer once with request.headers.POST https://api.anthropic.com/v1/messages, ReadableStream<Uint8Array> content stream body, and duplex: "half"; expected gateway URL is https://gateway.example.com/v1/messages, with the source unread before routed consumption and routed text exactly stream body.POST https://api.example.com/v2/chat/completions?stream=true, a ReadableStream<Uint8Array> containing {"model":"gpt-5","messages":[]}, and duplex: "half"; expected result is the identical source request, bodyUsed === false, and source body still readable./home/byk/Code/opencode-lore-v2/packages/core/src/fetch-interceptor.ts was modified after the 10 fail-first failures.jj-guide states that when .jj/ exists, repository mutations must use jj, not Git; in colocated .jj/ + .git/ repositories, Git may be used read-only but mutations must go through jj.jj-guide forbids interactive flags such as -i/--interactive, requires -m "msg" for describe/commit operations, requires verifying mutations using jj st and jj log, prefers stable letter-based change IDs over hexadecimal commit IDs, and forbids rebasing or describing immutable commits.jj st shows whether they are cleared. jj resolve must not be used because it is interactive.jj commit -m "feat: ..." finalizes @ and creates a new empty @, leaving content in @-; Style B, jj describe -m "feat: ..." before editing keeps edits auto-amended into @, and jj new should not be run at the end.jj undo, jj op log, jj op restore <op-id>, and jj workspace update-stale; bookmarks do not auto-advance, and after jj commit an existing bookmark should be moved with jj bookmark set <name> -r @-.system — it embeds” system messages inside the messages array./home/byk/Code/opencode-lore-v2/packages/core/src/fetch-interceptor.ts defines detectProtocolFromBody(bodyStr) as follows: require parsed object plus model; classify openai-responses when input is an array or max_output_tokens/previous_response_id is present; classify anthropic when top-level system exists alongside array messages; otherwise classify array messages as openai; invalid/unrecognized input returns null.shouldIntercept(url, gatewayBase) returns false when url.startsWith(gatewayBase), when isLocalHost(parsed.hostname) is true, or when URL parsing fails; otherwise it only intercepts paths matching LLM_API_PATH_PATTERNS.localhost, 127.0.0.1, 0.0.0.0, ::1, and [::1].LLM_API_PATH_PATTERNS recognizes /v1/{messages,chat/completions,responses}, /api/v1/{messages,chat/completions,responses}, /api/{messages,chat/completions,responses}, /openai/v1/..., /anthropic/v1/..., and /codex/responses, each allowing a trailing subpath.NON_STANDARD_PATH_REWRITES maps "/codex/responses" to "/v1/codex/responses"; PROTOCOL_GATEWAY_PATHS maps anthropic to /v1/messages, openai to /v1/chat/completions, and openai-responses to /v1/responses.extractBodyString() only synchronously examines RequestInit.body values that are strings, ArrayBuffers, or typed-array views; it returns undefined for streaming bodies and bodies available only through a Request, avoiding consumption of unknown streams.buildGatewayHeaders() preserves original request headers, sets x-lore-upstream-url and a sane absolute x-lore-upstream-path, and injects config.getHeaders() entries only when the corresponding header does not already exist; failures in getHeaders() are logged.installFetchInterceptor() uses process-global key Symbol.for("lore.fetchInterceptor.originalFetch") as a cross-module-copy double-install guard; this prevents stacked interceptors and the gateway→interceptor→gateway infinite-loop shape associated with issue #1027. Cleanup restores globalThis.fetch and writes null to the shared slot.originalFetch(rewrite.gatewayUrl, { ...init, headers }); Path 2 body-detects only synchronously readable RequestInit bodies on LLM-looking unknown paths and warns once per ${upstream.host}${upstream.pathname} when it cannot route them.fetch-interceptor-request.test.ts imports rewriteRequest from ../src/fetch-interceptor, defines GATEWAY = "https://gateway.example.com", and contains exactly 157 lines./home/byk/Code/opencode-lore-v2/packages/core/src/fetch-interceptor.ts contains 585 lines but still shows no rewriteRequest declaration/export, despite the test importing it._Request.text with TypeError: Body is unusable: Body has already been read from node:internal/deps/undici/undici:6979.{"originalBodyUsed":false,"originalLocked":false,"routedMethod":"POST","routedBody":"stream body","originalBodyUsedAfter":true}: the source began unused/unlocked, the routed request retained POST and read stream body, and consuming the routed body changed the original’s bodyUsed to true.{"originalBodyUsed":false,"originalLocked":false,"routedBodyUsed":false,"routedLocked":false,"routedMethod":"POST"} before consumption, then printed stream body; both original and routed bodies initially appeared unused and unlocked, and the routed request retained POST.