Dashboard › opencode › Distillation
37643bc3-7016-4e13-8c22-6b9929053181["lore_tm_v1_1tBC6E8AMvksO6BbYz11mSwSDywKk-jpxxy9OHVtN1Y","lore_tm_v1_WeA1B7JA8kOQ6jQiPjPLAdtPToXcz5k3fAA3qXm2bdY","lore_tm_v1_SJKQz57vVkeFHVSiNGlrIZv6h7E1pwT4rOIeaP08elo","lore_tm_v1_4MaGhe5W5a2K-O77GFTM3Z4rzdbHqEc7SefgR4HNzho","lore_tm_v1_HCZcvnt3LtPKOpOR84XeeCVziO3cdW6tcWz7R6Dhggc","lore_tm_v1_sW0il5ZohBjpOSD11cWZcSHfB4J7X6In2QlgN2USOms","lore_tm_v1_3k8hChHeVjMJgAnAmoS2GIgjACULSaBtVNTbCJdnYq0","lore_tm_v1_Vod0VB9YM_jbPtVW5bDHcm9qkSAfuNtQwHCA183XY4w","lore_tm_v1_6u_j2sDSyYE482kO9587T3S7iqH9LODsTISHD_RsdHY","lore_tm_v1_V5stNzTbEVNXI_RuDKsEkXZCZ7IeSyuR0ydxqvxLG2Y","lore_tm_v1_UC5SMZ-UFgC3RCARTvIU_3uhSPXwl6BEXFwpUvlLCYE","lore_tm_v1_mvmFZXjW82I7tfKzQv2AIJgoW8q_Ce_bsCjwgKUcNJk","lore_tm_v1_JL6i1ExCtepIw22o4i2-6KHLkfYHuVDZVwruBBgu6gE"]
/home/byk/Code/opencode-lore-v2 contained 15 changed files totaling 2,904 insertions and 196 deletions: modified packages/core/src/fetch-interceptor.ts, packages/core/src/index.ts, packages/opencode/package.json, packages/opencode/src/index.ts, packages/opencode/src/internal.ts, and pnpm-lock.yaml; added packages/core/test/fetch-interceptor-request.test.ts, packages/opencode/script/build.ts, packages/opencode/src/server-core.ts, packages/opencode/src/server-runtime.ts, packages/opencode/src/server.ts, packages/opencode/test/internal.test.ts, packages/opencode/test/package.test.ts, packages/opencode/test/server-runtime.test.ts, and packages/opencode/test/server.test.ts.wlpqmtos at commit 52e6687e1eae, described feat(opencode): add V2 server plugin; its parent was change uutomtup at commit 429114122aa1, described fix(gateway): preserve large recall continuations (#1730) on main./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/provider/github-copilot.ts disables the Copilot-only chat alias gpt-5-chat-latest because it conflicts with the Copilot GPT-5 Responses route, while leaving other provider catalogs unaffected.github-copilot.ts, the model.request hook runs for every route, unlike http.request, which the AI SDK route bypasses. For GitHub Copilot it loads the session best-effort, derives interactionType(evt.kind, session?.parentID !== undefined), sets X-Interaction-Type and X-Interaction-Id, and adds x-initiator: agent unless the interaction is conversation-agent.github-copilot.ts, the http.request hook is scoped to Provider.ID.githubCopilot; when x-api-key exists it clones and decodes the request body, computes requestMetadata(evt.request.url, body), and calls applyHeaders(..., true).packages/opencode/test/server.test.ts expects the V2 server plugin to register 3 hidden subagents in order: lore-distill (Lore knowledge distillation worker), lore-curator (Lore knowledge curator worker), and lore-query-expand (Lore query expansion worker), each with mode: "subagent" and hidden: true.packages/opencode/test/server.test.ts verifies setup registers both model.request and http.request; acquires runtime with /workspace/project; preserves provider headers such as authorization: Bearer provider; adds x-lore-session-id: ses_1; and rewrites baseURL from https://api.openai.com/v1 to http://127.0.0.1:3207/v1.https://api.openai.com/v1/chat/completions is passed to rewriteRequest(original, "http://127.0.0.1:3207", {}) and becomes http://127.0.0.1:3207/v1/chat/completions.release() to be called exactly once. If setup fails after one registration—even when disposal itself fails—the prior registration is disposed once, runtime release runs once, and setup rejects with "registration failed".parentID, still emits x-lore-session-id, and cleans up normally./workspace/a with remote github.com/example/a and /workspace/b with remote github.com/example/b each receive separate runtime/release state even though both use gateway http://127.0.0.1:3207./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/session.ts defines SessionRequestKind exactly as "primary" | "compaction" | "title" | "generate".SessionModelRequest contains readonly sessionID, agent, model, and kind, plus mutable optional baseURL and mutable headers: Record<string, string>. SessionHttpRequest contains the same readonly identity fields plus mutable request: Request; SessionHttpResponse adds readonly request and mutable response: Response.SessionRetryDecision is { retry: false } | { retry: true; delay: number }; SessionRetry contains readonly sessionID, agent, model, error, and attempt, plus mutable decision.SessionHooks exposes prompt, context, "model.request", "http.request", "http.response", and retry.packages/gateway/test/compaction.test.ts defines layered meta-request detection. Layer 1 uses x-lore-agent: known meta agents are always meta regardless of structure; known primary agents are not meta even when structurally meta; unknown agents fall through to heuristics.packages/gateway/test/compaction.test.ts are, in order: 1. title, 2. summary, 3. summarize, 4. categorize, 5. label, 6. classify.x-lore-agent: title classifies as meta even with a 2,000-character system prompt, 3 tools (bash, read, write), and 3 alternating messages; x-lore-agent: coder classifies as primary even with system prompt "Generate a short title for the conversation.", no tools, and one user message.x-lore-agent such as custom-agent, the compaction classifier uses structural heuristics: a short prompt, no tools, and one user message is meta, while a 2,000-character prompt, 3 tools, and 3 messages is not.maxTokens; the tested case with a 600-character system prompt, no tools, one user message, and maxTokens: 100 scores 9 (tools(3) + messages(3) + system(0) + maxTokens(3)) against the threshold of 8 and is classified as meta.packages/opencode/test/session-state.test.ts requires chat.headers to emit x-lore-session-id, x-lore-agent, and the current project’s x-lore-project; two plugin instances for different worktrees must retain independent project paths even though module-level state is shared.s1, s2, s3, sub-agent-1, and sub-agent-2—to receive the same project path, and require meta-agent requests such as agent title to receive x-lore-project so gateway routing does not fall back to cwd.x-lore-git-remote sibling-leak regression creates two non-repository temporary directories, initializes project B before project A, verifies project A emits its own x-lore-project but no x-lore-git-remote, and cross-checks that project B likewise emits no remote.