Dashboard › opencode › Distillation
8dad1cc6-1671-4ee6-9ead-aca65c2ad677["lore_tm_v1_DsEmEG8UOFVwbprnlZF5EG34B35_s1db8UTcSDWpQsA","lore_tm_v1_3SRH06ixF0fQl4YcK7GXm76WBFhVCmYuwbtPaofj_gA","lore_tm_v1_Y1hqAHm3jatFTM2tK2bKmpDHleVpW17ob32F8wiswjc","lore_tm_v1_jhOy9UBx1ol-2SVnp7CC_lVta_gBMitzdmiaztpO9JE","lore_tm_v1_eTvpgiQiXr6mf9TZ21Q04GiuxHB4re0h8F4vcxdEfwE","lore_tm_v1_6W5gBsDvszesmvfiHhV3bUmRGhmSdYfN5o50XekmmHQ","lore_tm_v1_EdBo165xjXKGubYqDSYfzRdz8vcris2aCdrrkFXKZ9E","lore_tm_v1_Cs0uyRuOvN7r6_-pJxAqd5O2ZR4XyuRu8GNdGRS_7xc","lore_tm_v1_rpvgCBvOtCeHPONoiCoUW1mTsbDVXjJMgJgLrAEwJG8","lore_tm_v1_HRh1aacRxpdh4yUYh1nBvV7QoTPRF5YDhf_v8Ec71is","lore_tm_v1_atgPzmNo6UUREO8WR68OUsAsCcsEPFCYPwuYthmsHBA","lore_tm_v1_-LwbdnOxCdjsqjX6YK6ucBV9RpAIkRYyV0gEOOuLgSU","lore_tm_v1_Bk52tJV04fBwSgTBxewjmT2ZE3bJaq523rG2b5PMcTo","lore_tm_v1_-1gapqjn96_eXK_ihCo6d6KrSXPB1YAaMOXnSqkXLv8","lore_tm_v1_EXRP_3aWl5Y7WqfIX4caIWqfpWe1FIc1gx6v5H8yLKc","lore_tm_v1_DUp0wqUUGHCsWxNMQHs3yVKG7wExh7m-FeUXrUC257Q","lore_tm_v1_kL8OemGAWlc-uvsfDAVbH0qU_PgUoz870JSgEC5706M","lore_tm_v1_1l6WhosGPs0NXweW5EX0OkXNgkiy6WFbJSgBZWO_oXY","lore_tm_v1_bWfSoH8VpxWgdFlS95IQkj8PBJJhnWl0NhIxbq7eFos","lore_tm_v1_-y5PC1-mtb49hGPCPC5yf3mEXLQc3TqMFDHjrUMPubk","lore_tm_v1_mwP9P57AswcsmPodrhLuPVG1QrKWYKXDikudOQOH4KA","lore_tm_v1_OvXD_p3FQWvQ73xu6Nhy7Pkdg-sAfMILOg6Yas321bU","lore_tm_v1_tqtAh7Y0EKb2cs5eMWzjaAlhe1txROJpqvBa02FzXBs","lore_tm_v1_1463C9cJvfF1NglMZ3fCOpY3N53WtsFv7irSfj-ocL8","lore_tm_v1_3sbyU5BSKjLsGZM7wt6wO4AFn8BdYQE_kqheAuJui9o","lore_tm_v1_GzmAgm8WCWP77usXEAalOwfHeJnGOPY29EQE3Xo4loU"]
packages/opencode/test/internal.test.ts was modified.packages/opencode/test/internal.test.ts passed exactly 13/13 tests in 1/1 file. Timing: start 10:21:01, duration 4.70s, transform 2.53s, setup 653ms, import 3.69s, tests 19ms, environment 0ms.remote gateway access headers > parses empty values and CRLF without changing legacy semantics passed in 4ms; the other 12 passing tests were the previously recorded credential-filtering and surfaceGatewayUnavailable cases.packages/core/test/fetch-interceptor-request.test.ts defines 8 rewriteRequest test cases/groups: 1. routes a V2-style Request from https://openrouter.ai/api/v1/chat/completions?stream=true&trace=abc to https://gateway.example.com/v1/chat/completions?stream=true&trace=abc while preserving POST, body, authorization: Bearer sk-test, x-api-key: api-key-test, query, and caller request usability; adds x-lore-project: /home/me/project, x-lore-session-id: session-123, x-lore-upstream-url: https://openrouter.ai/api, and x-lore-upstream-path: /api/v1/chat/completions; invokes the observer once with routed headers. 2. Preserves caller-set x-lore-session-id: request-session over dynamic headers. 3. Returns a direct gateway Request unchanged and observes its original headers without adding x-lore-project. 4. Returns local requests unchanged for localhost, 127.0.0.1, 0.0.0.0, and [::1], each on port 8000 at /v1/messages. 5. Returns non-LLM request https://registry.npmjs.org/package unchanged. 6. Routes a streaming body on known path https://api.anthropic.com/v1/messages without reading the original, preserving "stream body". 7. Does not read or route a streaming body on unknown path https://api.example.com/v2/chat/completions?stream=true; original body remains readable and contains "model":"gpt-5".@loreai/opencode@0.40.0 package tarball at /tmp/opencode/loreai-opencode-0.40.0.tgz contained exactly: LICENSE, package.json, README.md, src/index.ts, src/internal.ts, src/server-runtime.ts, and src/server.ts.10:21:46, duration 13.31s, transform 9.00s, setup 2.54s, import 22.07s, tests 9.92s, environment 1ms.54ms with 4 threads.pnpm-lock.yaml contains @opencode/plugin at lines 232, 1609, and 7527. Under packages/opencode, @loreai/core and @loreai/gateway are workspace:* dependencies; @opencode-ai/plugin and @opencode-ai/sdk are dev dependencies with specifier ^1.1.39 resolved to 1.2.15; @opencode/plugin is a dev dependency pinned to 0.0.0-beta-19378.feat/nightly-release-channel, the changes under discussion were unrelated to nightly, and they needed a new branch.AGENTS.md had modifications, likely from Lore distillation, that should be included.useTestConfigDir(prefix, { isolateProjectRoot: true }) when a test might call resolveOrg, detectDsn, or findProjectRoot with the config directory as cwd; this creates a .git inside the temp directory and prevents project-root discovery from walking into the actual repository and scanning source for Sentry DSNs.mockFetch() calls replace one another because each assigns a new globalThis.fetch; multi-endpoint tests should use one unified fetch mock rather than sequences such as mockBinaryDownload() followed by mockGitHubVersion(), which causes the binary URL to hit the replacement version mock and return 404.gh-pages target and whether it would interfere with nightly files.src/lib/db/release-channel.ts; that new file defines getReleaseChannel(), setReleaseChannel(), and parseReleaseChannel(), stores key release_channel in the metadata table, and defaults to "stable".src/commands/cli/setup.ts to add --channel and call setReleaseChannel() within runConfigurationSteps, wrapped in bestEffort.src/commands/cli/upgrade.ts: nightly and stable are positional channel selectors; --force bypasses the up-to-date check; resolveChannelAndVersion(positional) accepts one positional argument and no channel flag; migrateToStandaloneForNightly() auto-migrates non-curl installs; the selected channel is persisted upfront even during --check.src/lib/upgrade.ts: added fetchLatestNightlyVersion(signal?) fetching https://github.com/getsentry/cli/releases/download/nightly/version.json; added NIGHTLY_TAG = "nightly"; added optional downloadTag to downloadBinaryToTemp and executeUpgrade; made fetchLatestVersion(method, channel) dispatch between nightly and stable.src/lib/version-check.ts to read getReleaseChannel(), use fetchLatestNightlyVersion for nightly users, and distinguish the nightly notification text New nightly available: from stable update messaging../server export pointed to raw TypeScript, but the Node SEA rejects TypeScript entrypoints inside node_modules as it previously rejected bun-pty. Assistant decided to ship JavaScript for only the V2 export while preserving the legacy raw-TypeScript root export.pnpm pack, not npm pack, because pnpm pack rewrites workspace:* references to release versions; .github/workflows/ci.yml packs packages/core, packages/opencode, packages/pi, and packages/gateway into dist-tarballs.packages/core/script/build.ts builds publishable ESM bundles with esbuild: dist/node/index.js uses node:sqlite, dist/bun/index.js uses bun:sqlite; target conditions are ["node"] or ["bun"]; both use platform: "node", format: "esm", target: "esnext", sourcemaps, inline legal comments, and externalize node:*, bun:*, onnxruntime-node, sharp, and sqlite-vec.packages/opencode/src/server.ts imports rewriteLoreRequest from @loreai/core and Plugin from @opencode/plugin.packages/opencode/package.json was modified and packages/opencode/script/build.ts was created, then modified again.@loreai/opencode@0.40.0 build generated dist/server.js (8.5kb) and dist/server.js.map (22.6kb) in 8ms, but declaration generation failed with TypeScript TS2210: project root was ambiguous while resolving import-map entry . in packages/core/package.json; TypeScript required the rootDir compiler option. Command ran under Node v24.16.0 with TypeScript 5.9.3 and exited status 1.packages/opencode/script/build.ts was modified to supply --rootDir /home/byk/Code/opencode-lore-v2/packages/opencode/src to declaration generation.@loreai/opencode@0.40.0 build generated dist/server.js (8.5kb) and dist/server.js.map (22.6kb) in 6ms, but declaration generation then failed with src/server.ts(1,10): error TS2305: Module '"@loreai/core"' has no exported member 'rewriteLoreRequest'. The build exited status 1 under Node v24.16.0.server export rather than invoking Loreβs preserved legacy root export./home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/source.ts, configured local plugin sources outside config roots are watched directly. Watches start on first sighting and are never torn down individually; stale watches cost one deduplicated filesystem handle and a no-op activation, and all watches terminate with the layer scope.ConfigPluginSource.watchConfiguredSources uses watched: Set<string> to deduplicate configured absolute targets, skips remove operations and sources already covered by {plugin,plugins} directories, subscribes by target type ("directory" or "file"), publishes updates through configuredChanges, logs configured plugin watch failed on watcher failure, and forks each watcher with Effect.forkScoped({ startImmediately: true }).ConfigPluginSource.operations() reads config entries, runs scan(fs, location, entries), invokes watchConfiguredSources(entries, operations), and returns operations. changes() merges filtered config changes with Stream.fromPubSub(configuredChanges).ConfigPluginSource.scan resolves absolute configured plugin directories through Host.resolve({ directory: operation.target }); direct files become { server: pathToFileURL(operation.target).href }. It rejects configured plugin paths that are files with warning configured plugin path must be a directory, ensures resolved directory entrypoints remain inside the configured root using FSUtil.contains, and records mtime as the maximum timestamp across all resolved entrypoints plus package.json./home/byk/Code/opencode-v2-pilot/packages/plugin/src/host.ts defines host entrypoints server, tui, and rpc. Host.resolve(target) tries server subpaths in order ["server", ""], then ["tui"], then ["rpc"]; package targets resolve as <name>/<subpath>, while directory targets resolve relative paths with an empty subpath falling back to index.Host.resolve treats ENOENT, ENOTDIR, MODULE_NOT_FOUND, ERR_MODULE_NOT_FOUND, ERR_PACKAGE_PATH_NOT_EXPORTED, and ERR_UNSUPPORTED_DIR_IMPORT as missing candidate entrypoints and continues; other errors are rethrown. Host.load(entrypoint) delegates to importModule(entrypoint).Host.resolve is exercised in /home/byk/Code/opencode-v2-pilot/packages/plugin/test/host.test.ts and used by /home/byk/Code/opencode-v2-pilot/packages/core/src/plugin/module.ts, /home/byk/Code/opencode-v2-pilot/packages/core/src/config/plugin/source.ts, /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/list.ts, and /home/byk/Code/opencode-v2-pilot/packages/cli/src/commands/handlers/plugin/add.ts.