Dashboard › opencode › Distillation
7d71aedc-7b0e-4f77-b90b-17c47341592a["lore_tm_v1_ILmzKDx3daSA7aO1pT_8BRCrf4AfZkJDbrVRoVvcrig","lore_tm_v1_qd-XP5sda1ak8jPNvjJiqneAIOgrWy-1zrCc4WnpWfs","lore_tm_v1_XK1GZzA0VYt_ToyV1iyRxs2dXMsAv4ovWaYHeQ03hC4","lore_tm_v1_QsgxsDhVK_4Hz59opWERxEiU_ELHVVveGMuWz8eXklI","lore_tm_v1_vYXQChx999QUQIqIl_Hs_Y4d9UgdVKtjaAj72uT140s","lore_tm_v1_4_yVemWtzdj9kwHPlUEmU9QboBNVa2uympOOe_0ssro","lore_tm_v1_kGFOot2KG4WMF9HWrnNLDPVQyJTTDf-B2VTCeSL9-VY","lore_tm_v1_4I-sOnlNsiZhsUjWm6YATzvmSH9z--PhdqUZ0jD77tQ","lore_tm_v1_nKVpH2r88cfFdvHs2l2NNc9hmYkjtWBH9RhI3l04_oY","lore_tm_v1_iiIX53lGup3TFkcMvfiapuAEknaW-EvdXTXwP6698cw","lore_tm_v1_06RibahJIxnAbg3z_Z2U3yR-ay13TgI7UP9uI_oKJiM","lore_tm_v1_3MWG2MGSQMNEOyxMyRz9nZjEPrs9nXAvz4hGB-Sbqg4","lore_tm_v1_MaQ0_otSELqiuIOY5OuVYw2Bdl3Frn4v3r0jIFOFEb8","lore_tm_v1_8VkYIr1ad3epTtFv69jBHU2TGNXFG4J9RNexeYJwCFU","lore_tm_v1_PM2TDvqTXEY4QHqpBACNtn67biCzRrRWhU5KXbl8ERo","lore_tm_v1_JHFXhTOl524G9DkXk5fw-LSVDEkoFI8Ej9Yf7VOZkNk","lore_tm_v1_xwY6e44NWEKpjdZdygLJzMPwh4A5trbbIqy6SBeYVsU","lore_tm_v1_vmkXEpEMWG-u_zE43C9fb1935Wb1PmHVboovIQRF4Ug","lore_tm_v1_SfgzDZseJJ7lUEbvLdI502yTYEP1TRfpPOYLuiGSD4w","lore_tm_v1_7nlXl0EnfBWwoqRe7yBcG8E-KhM120nzSKRzNr39uPI","lore_tm_v1_YBQj9LHDeiwZgITbmNPqHgWb7WWlEJVOFFECDsQjOgU"]
@ was change wlpqmtos, commit f6c64b12, bookmark lore-v2-plugin, description feat(opencode): add V2 server plugin, based on uutomtup / 42911412 (main, fix(gateway): preserve large recall continuations (#1730)). Changes spanned exactly 13 files with 2,747 insertions and 92 deletions: modified packages/core/src/fetch-interceptor.ts, packages/opencode/package.json, packages/opencode/src/index.ts, packages/opencode/src/internal.ts, packages/opencode/test/internal.test.ts, and pnpm-lock.yaml; added packages/core/test/fetch-interceptor-request.test.ts, packages/opencode/script/build.ts, packages/opencode/src/server-runtime.ts, packages/opencode/src/server.ts, packages/opencode/test/package.test.ts, packages/opencode/test/server-runtime.test.ts, and packages/opencode/test/server.test.ts.packages/opencode/test/package.test.ts version-independent so a Craft version bump cannot break release automation.packages/opencode/src/server-runtime.ts and packages/opencode/test/package.test.ts to remove the redundant gateway probe and make package validation version-independent.v4.1.8; start 12:59:04, duration 4.09s (transform 2.19s, setup 1.09s, import 4.13s, tests 87ms, environment 0ms).null for primary sessions, are cached; failures are not cached so transient failures can be retried rather than permanently misclassifying a real sub-agent.chat.headers is cached and never blocks or throws on failure.log, remaining available via lore logs.x-lore-git-remote only from the remote paired with the current path, never a remote left over from a different project’s plugin call./home/byk/Code/opencode-lore-v2/packages/opencode/src/index.ts exports only LorePlugin and the same-reference default. Helpers remain in ./internal.ts because OpenCode’s legacy loader invokes every exported function as a plugin and throws on non-function exports; leaked helper exports previously pushed undefined into the hooks array and caused undefined is not an object (evaluating 'A.event'). Export shape is guarded by test/index.test.ts.packages/opencode/src/index.ts uses known ports [3207, 5673] and resolves in this order: reachable normalized LORE_REMOTE_URL; reachable normalized LORE_GATEWAY_URL; port returned by dynamically imported @loreai/gateway.readPortFile(); then known ports at http://127.0.0.1:${port}. If discovery fails, startInProcess() dynamically imports @loreai/gateway and calls startGateway({ quiet: true, local: true }).lastGatewayStartError; unavailable-gateway messaging may recommend pnpm --filter @loreai/gateway run bundle or run build when the error resembles a missing/stale build. surfaceGatewayUnavailable(ctx.client, msg) provides a TUI-safe toast while file and Sentry logging retain the error.packages/opencode/src/index.ts comprises processInitDone, processLoreActive, processLoreBase, and memoized loreInitPromise. Per-project state is keyed by ctx.project.id in projectState, while currentProject: { path: string; gitRemote: string } | undefined is only the fallback for requests bypassing chat.headers.projectState and sessionParent use SESSION_STATE_TTL_MS = 24 * 60 * 60 * 1000 (24 hours), with opportunistic stale-entry reaping. A project entry stores { projectPath, gitRemote, lastSeenAt }; a session entry stores { parentID: string | null, lastSeenAt }.discoverWorkspaceRoot(ctx.worktree || ctx.directory). getGitRemote(thisProjectPath) is rerun only when the project’s resolved path changes; otherwise the cached remote is reused.resolveParentSession(client, sessionID) calls client.session.get({ path: { id: sessionID } }), derives res.data?.parentID ?? null, and sends non-null parents as x-parent-session-id so the gateway recognizes OpenCode Task child sessions and sizes LTM injection according to issue #1300.isInertTestEnv(): LORE_OPENCODE_FORCE_ACTIVE === "1" overrides inertness; otherwise NODE_ENV === "test" or any process argument containing .test. keeps the plugin from gateway probing/startup and from patching globalThis.fetch.log.silenceStderr() is applied before gateway startup so plugin and bundled gateway logging cannot corrupt the TUI; logs still reach the log file and Sentry sink. Inert test mode preserves unrelated suites’ console behavior.config hook disables built-in compaction with { auto: false, prune: false }; registers lore-distill, lore-curator, and lore-query-expand with mode: "subagent" and hidden: true; and calls applyLoreProviderConfig(cfg, gatewayBase). mode: "subagent" is required because OpenCode otherwise defaults agents to mode: "all" and exposes them in the primary Tab picker and @-mention/skill list despite hidden: true.chat.headers adds gateway access headers, x-lore-session-id, x-lore-agent, optional x-parent-session-id, project-scoped x-lore-project and x-lore-git-remote, and runtime provider id as x-lore-provider. For provider id P, it reads LORE_UPSTREAM_${P.toUpperCase().replace(/-/g, "_")} into x-lore-upstream-url unless already present, and forwards only allowed headers parsed from LORE_UPSTREAM_EXTRA_HEADERS.installFetchInterceptor({ gatewayBase, getHeaders }) once per process. It preserves original provider auth headers and URLs while rerouting LLM requests; getHeaders() provides gateway access headers plus the self-consistent currentProject path/remote fallback for requests such as embedding or image generation that bypass chat.headers./home/byk/Code/opencode-lore-v2/packages/opencode/node_modules/@opencode/plugin/dist/promise/index.d.ts re-exports PluginOptions, StorageEntry, StorageScanOptions, and StorageScanResult; exposes Plugin as a namespace from ./plugin.js; and exports Agent, Command, Connection, Credential, Integration, Location, Mcp, Model, PersistentPty, Provider, Reference, Rpc, Skill, Vcs, WebSearch, and Worktree from their schema packages.. failed with Error: There is no jj repo in ".", indicating the command was issued outside the repository root.@opencode/plugin installation: because Plugin.define is an identity helper, source uses the plugin contract only as a type and exports the definition object directly. This retains type checking and prevents a Node SEA from trying to resolve a host SDK copy from inside the plugin package.packages/opencode/src/server.ts, packages/opencode/src/server-runtime.ts, packages/opencode/test/server-runtime.test.ts, and packages/opencode/test/package.test.ts for the runtime-independent V2 definition and associated lifecycle/package behavior.packages/opencode/test/server-runtime.test.ts now parameterizes disabled-state coverage over both LORE_DISABLED="1" and LORE_DISABLED="true", replacing coverage limited to a single disabled spelling.v4.1.8; start 13:02:42, duration 3.82s (transform 2.42s, setup 1.20s, import 2.99s, tests 258ms, environment 0ms).V2 server runtime > releases the gateway when project identity resolution fails in packages/opencode/test/server-runtime.test.ts.shutdown to be called once but observed 0 calls at packages/opencode/test/server-runtime.test.ts:77. Result was exactly 1 failed test and 5 skipped tests in 1 failed file; start 13:03:46, duration 4.55s (transform 2.49s, setup 529ms, import 3.78s, tests 26ms, environment 0ms).packages/opencode/src/server-runtime.ts so a gateway acquired before project identity resolution is released when identity resolution throws, while the identity error continues to propagate.8ms, with exactly 1 passed and 5 skipped tests in 1 passing file; start 13:04:27, duration 4.92s (transform 2.70s, setup 684ms, import 3.93s, tests 12ms, environment 0ms)./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/vcs.ts defines VcsScope with readonly directory, worktree, canonical, and optional store. VcsBranchesInput adds optional search and limit; VcsDiffInput adds mode, optional base, context, and maxOutputBytes.VcsDefinition requires id, name, info, branches, status, and diff, with optional base; operations receive { readonly signal: AbortSignal }. VcsDomain extends VcsApi with transform: Transform<VcsEditor> and reload(). VcsEditor supports add(definition) and a mutable default selection through default.get() / default.set(selection).