Dashboard › opencode › Distillation
15c69d8a-2d1f-4e1c-8ebe-babebc0b3cdb["lore_tm_v1_hLXPuSOvTJhSSHlljNAzxCWYopKI1AKUiWS0WS7qFUE","lore_tm_v1_k67v8jZhMCKsCAd9MVs8LcqANEmcGzXNJfyOpEM6t84","lore_tm_v1_f-45-ciljZgSTOQ5tPXW4E_PhF2_jYrZm81qQV_BXpc","lore_tm_v1_gdbAR5W2l5QGGS_aAxqQLEQywa6EiSNGId6ytfAVlEc","lore_tm_v1_Suh81e4LgqoW2GPX09SCuZxhg8vw0U-3TSCvxMGcSWI","lore_tm_v1_3EA7CMXZniuGnzZ7BRjcMQJYKp6y_esQwKg0qAWeZGM","lore_tm_v1_5Lf4s5Spki_4iBjtOClyc9kUjaH-Vvl-1DfEoWytPrc","lore_tm_v1_RYmbdkG385lZbfDEqfNKH1lIm-5Q_VnFAIWT-5g0-MU","lore_tm_v1_hqC-jp4wMbWLzbIbW5k7Xlap1aYxgLzP_YEQW30O50o","lore_tm_v1__D_cVrNv9V5rN9N63znS7uBaW6s-UcQOeXKrg0I8NkI","lore_tm_v1_rE64ybs7th3Ip1yUMGGm3suzeTYKHukTCYYwtRNbYaY","lore_tm_v1_n0oYZmCwIFZpsOgwMQM7ZiAZKxKNkMl1jd83Ktbw3SU","lore_tm_v1_QqKJeiSF9WsHu9hnagdrOOoLPUiekLFAItxf7OAkcOI"]
packages/core/test/worktree.test.ts: "cannot remove a worktree from another project through the current location", "rejects workspace-qualified locations before running worktree operations", and "list invokes the location's strategies before returning inventory"; packages/core/test/vcs.test.ts: "passes location scope and bounded diff options to providers" and "stops in-flight and queued VCS reloads when its layer closes"; and packages/core/test/tool-write.test.ts: "writes an external symlink target with only its in-location permission".packages/core/test/plugin.test.ts contains tests "unloading a plugin removes its commands and runs cleanup" at line 120 and "does not let asynchronous plugin cleanup block recovered registry readiness" at line 401, with plugin id "async-cleanup" at line 408.packages/core/test/plugin.test.ts test "updates inventory metadata without restarting an unchanged generation" activates plugin { id: "metadata", revision: "1", source: { type: "package", target: "fixture" } }, then reactivates it with outdated: true; it expects loads to remain 1 and inventory source to become { type: "package", target: "fixture", outdated: true }.packages/core/test/plugin.test.ts test "loads a local plugin with its configured options" loads plugin/fixtures/greeting.ts through PluginModule.make() with Watcher.testLayer, passing options: { description: "Configured greeting" }; after activation, command "greet" must have description "Configured greeting".packages/core/test/plugin.test.ts test "unloading a plugin removes its commands and runs cleanup" activates plugin id "greeting" revision "1", registers an Effect.addFinalizer() that sets cleaned = true, and adds command "greet" through ctx.command.transform(...). Before plugins.activate([]), "greet" exists and cleaned is false; afterward "greet" is absent and cleaned is true.packages/core/test/plugin.test.ts test "reports a failed plugin without blocking a healthy plugin" activates "broken" revision "1" whose effect dies with Error("Setup failed") alongside healthy "greeting" revision "1" that registers "greet"; expected outcome is the broken plugin has status: "failed" with an error containing "Setup failed", while "greet" remains defined.packages/core/test/plugin.test.ts begins a test "disables a plugin whose transform fails after setup without publishing its partial edits" using Plugin.Service, Command.Service, Integration.Service, and a cleaned flag.packages/core/test/worktree.test.ts tests "does not fall back to Git when a registered strategy fails" and worktree transform registrations with disposable handles; packages/core/test/workspace.test.ts test "rejects unregistered workspace providers"; and packages/core/test/websearch.test.ts tests "uses the default set by a transform", "reloads active transforms from their current source", "keeps config transforms above the persisted selection", and "keeps the random provider across queries, default lookups, and reloads".packages/core/test/websearch.test.ts exercises providers "exa", "parallel", "tavily", and "temporary"; transform defaults may be set to a provider ID, "random", false, or WebSearch.ID.make("missing"); registrations expose dispose, and websearch.reload() reloads active transforms./home/byk/Code/opencode-lore/packages/opencode/src/index.ts imports plugin types from @opencode-ai/plugin and imports log, getGitRemote, discoverWorkspaceRoot, and installFetchInterceptor from @loreai/core; internal helpers imported from ./internal are applyLoreProviderConfig, gatewayAccessHeadersForRemote, probeGateway, shouldForwardUpstreamExtraHeader, and surfaceGatewayUnavailable./home/byk/Code/opencode-lore/packages/opencode/src/index.ts explain that helpers live in ./internal.ts so they are not re-exported from the plugin entry: OpenCodeβs legacy loader invokes every exported function as a plugin, and leaked helpers pushed undefined into the host hooks array, causing event dispatch to crash with undefined is not an object (evaluating 'A.event').chat.headers hook./home/byk/Code/opencode-lore/packages/opencode/src/index.ts defines KNOWN_GATEWAY_PORTS = [3207, 5673]. resolveGatewayUrl() tries, in order: 1. LORE_REMOTE_URL after stripping a trailing slash and probing it, falling through to local discovery if unreachable; 2. LORE_GATEWAY_URL, also normalized and probed; 3. a dynamically imported @loreai/gateway readPortFile() result; 4. known ports 3207 and 5673 at http://127.0.0.1:${port}. It returns the first reachable URL or null./home/byk/Code/opencode-lore/packages/opencode/src/index.ts documents startInProcess() as importing @loreai/gateway as a library and using startGateway() with fallback order 3207 β 5673 β random, including automatic port-file management; it returns the started gateway URL or null on failure./home/byk/Code/opencode-lore/packages/opencode/src/index.ts exports LorePlugin as export const LorePlugin: Plugin = async (ctx) => { at line 242 and exports it as default at line 511./home/byk/Code/opencode-lore/packages/opencode/test/ contains exactly the displayed files: 1. index.test.ts, 2. routing.e2e.test.ts, 3. internal.test.ts, 4. gateway-smoke.test.ts, 5. subagent-detection.test.ts, 6. tui-silence.test.ts, 7. session-state.test.ts.packages/sdk/test/promise.test.ts test "Promise host uses the embedded router" creates a temporary config with OpenCode.create({ events: { persist: true }, config: { directory: config, project: false, content: "{}" } }), creates a location-scoped session, verifies sessions.get() returns it, verifies sessions.list({ directory }) contains it, and verifies sessions.log() contains a "session.created" event. Looking up Session.ID.create() for a missing session must reject with { _tag: "SessionNotFoundError", sessionID: missingSessionID }; opencode.close() is called twice to validate repeat closure.packages/sdk/test/promise.test.ts test "Promise event streams support cancellation" subscribes with an AbortController signal, expects the first event to match { type: "server.connected" }, aborts while the next iterator read is pending, and expects { name: "ClientError", reason: "Transport" }, followed by events.return?.().packages/sdk/test/promise.test.ts test "closing cancels active Promise event streams" subscribes without a signal, receives { type: "server.connected" }, leaves the next read pending, calls opencode.close(), and expects the pending read to fail with { name: "ClientError", reason: "Transport" }.OpenCode, Session, and SessionMessage; disables file watching with fs: { filewatcher: false }; keys configuration from metadata(session.metadata).account; creates sessions across separate locations/hosts; checks inbox state and prompt text prefixes; and includes expected configuration sequence ["healthy", "retry", "retry"].{ account: "alpha", labels: ["review"] }, expects a restarted hostβs session list to contain [sessionID], expects prompt output "alpha/2: After restart", tracks cleanup/setup arrays, and uses a 20_000 ms test timeout.packages/sdk/test/instances-lifecycle.test.ts test "a cancelled borrower cannot strand a later failed instance construction". It creates an EmbeddedHost with config content "{}", models: { fetch: false }, fs: { filewatcher: false }, and instance key "shared".instances.configure records numbered acquisitions/releases with Effect.acquireRelease; attempt 1 publishes its fiber, waits on a deferred release, then fails with Error("Configuration unavailable"), while later attempts return { plugins: [] }."1 second" and release attempt 1. A later instances.provide(session) succeeds, yielding acquired = [1, 2] and released = [1]; closing the host yields released = [1, 2].packages/plugin/src/promise/agent.ts defines AgentEditor methods exactly as: list(): readonly DeepMutable<Agent.Info>[], get(id: string): DeepMutable<Agent.Info> | undefined, default(id: string | undefined): void, update(id: string, update: (agent: DeepMutable<Agent.Info>) => void): void, and remove(id: string): void.packages/plugin/src/promise/agent.ts defines AgentDomain extends AgentApi with readonly transform: Transform<AgentEditor> and readonly reload: () => Promise<void>.packages/core/test/session-native-compaction.test.ts creates instructions with key Instructions.Key.make("test/native"), string JSON codec Schema.toCodecJson(Schema.String), read value "Current instructions", and render behavior { initial: String, changed: (_previous, value) => value, removed: () => "removed" }, then calls InstructionState.prepare(db, bus, instructions, sessionID).packages/core/test/session-native-compaction.test.ts registers a "session" / "model.request" hook that assigns event.headers["x-test-hook"] = event.kind and a "session" / "http.request" hook that sets request header "x-http-hook" to event.kind.prompt(text: string, synthetic = false) using Effect.fnUntraced; it creates a SessionMessage.ID, admits an inbox item of type "synthetic" or "user" with payload { text } and delivery "steer", then publishes SessionEvent.InboxDelivered with { sessionID, inboxID: id }.