Dashboard › opencode › Distillation
bab8f63f-08b6-4e79-bc3c-5430f9387c00["lore_tm_v1_goLjibA8bIQugycs1zNxTlDzwGl9OpxYkxBSRDKpFnY","lore_tm_v1_ZamoS9bdiqbqEgdLEGS9mhph4B2ctgcDBh00BWygk4M","lore_tm_v1_xdOx8TgNfmSyPFu8CC3Kx1BJMjwoXSNYF0gCjt6Ldcw","lore_tm_v1_L6JOnwz42VLdplYqEZ3UhF9zBalZ8rO7vp72ciR2hRQ","lore_tm_v1_53pZzDQPIxajIwIk3IYv6LAADY1BmaOmc4anVelV2Wk","lore_tm_v1_laK-ME4t81g-vjHKdKEw-Zoj7k9Q81Jk7Vaz7SEDxD4","lore_tm_v1_FUaLtB3I_MgcpRvy5nw1xtVV-AJ7z1LSclTdVGCWp9A","lore_tm_v1_LrANWenaBNOgiisvASL7v_UM4IuCUheLp1woEGzaDiw","lore_tm_v1_IfI9n2zY79abA9Llj9cx2aTqYhqqrgdfo-YVNx2CoBY","lore_tm_v1_2lYBEB5JBlhdRwDwr32xk2LO_lv44TGt0pJZYQLP3hg","lore_tm_v1_Akam2Iw9l-lUYHnaCMTaSMxgLLen-eqU1ZqlTxysfdA","lore_tm_v1_vbLrYnSxntidK8dq3wK0-SMuhaGBlFAirrABFxp4f-E"]
/home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/worktree.test.ts verifies Promise worktree callback interruption propagates through its AbortSignal: plugin "cancel-worktree" registers strategy "cancel" whose create promise rejects with Error("cancelled") on abort; interrupting the scoped fiber changes signal.aborted from false to true, and the resulting failure has interrupts only./home/byk/Code/opencode-v2-pilot/packages/schema/src/config/plugin.ts defines ConfigPlugin.Entry with required package: Schema.String and optional options: Schema.Record(Schema.String, Schema.Unknown); Plugin is Schema.Union([Schema.String, Entry]), and Plugins is an array of that union./home/byk/Code/opencode-v2-pilot/packages/plugin/src/promise/agent.ts defines AgentEditor operations in order: list(), get(id), default(id | undefined), update(id, update), and remove(id); AgentDomain extends AgentApi with transform: Transform<AgentEditor> and reload: () => Promise<void>./home/byk/Code/opencode-v2-pilot/packages/core/src/agent.ts uses default agent ID Agent.ID.make("build"); its mutable state contains agents: Map<ID, Types.DeepMutable<Info>> and optional default?: ID.Agent.Editor exposes list, get, default, update, and remove; Agent.Interface additionally exposes effectful get, resolve, select, and list.Info.default(id) plus allow permissions for shell/*/*, tool-output/*, global.tmp/*, and global.config/*; editor.update() creates a missing agent before mutation and always resets current.id = id.mode !== "subagent" and hidden !== true; selection order is configured default, then "build", then the first selectable agent. select() falls back to ID "build" even if no selectable info exists, and list() moves the selected default to the front./home/byk/Code/opencode-v2-pilot/packages/plugin/test/host.test.ts makes every candidate entrypoint throw if evaluated to enforce resolution-only behavior.package.json, local conventional entrypoints when package.json has no exports, preference for an explicit server export over the root export, fallback to the root export using import rather than require conditions, and rejection of an exported entrypoint whose file is missing./home/byk/Code/opencode-v2-pilot/packages/sdk/test/instances-effect.test.ts test "reconstructs configured instances before automatic recovery executes tools" configures instances by metadata.threadID; generation 2 blocks on a Deferred before returning plugin "thread-tools", which grants agent "build" wildcard permissions, sets session-context temperature to 0.25, and registers tool "thread_echo" with description "Report the configured thread".configured === ["thread-recovery", "thread-recovery"], closed === [1, 2], executed === [2], recovered session title "thread-recovery:2", and exactly 3 LLM requests each with temperature 0.25 and tools ["thread_echo"]. Waits use "5 seconds" and the test timeout is 15_000.configured is []; prompting first configures "thread-recovery". During reconstruction, no additional LLM request occurs before generation 2 configuration is released."qualifies application keys by workspace and reselects a moved Session" creates 2 memory workspaces and 2 sessions sharing threadID: "same-thread"; each workspace gets its own instance configuration and plugin "placement-hook" appends :${ctx.location.workspaceID} to prompts."Moved" becomes Moved:${secondWorkspace}, while configured remains exactly ["same-thread", "same-thread"] with no third configuration. The test timeout is 15_000."configures instances from services provided to the SDK layer" provides Personas to OpenCode.layer; Personas.of(threadID) returns "persona-for-${threadID}", and plugin "persona" appends that persona to prompt text."thread-7" instance construction fails with Error("Persona store cold"); its acquired resource is immediately finalized as "thread-7:1", the next prompt retries successfully as "Hello:persona-for-thread-7", attempts are exactly ["thread-7", "thread-7"], and closing the host then finalizes "thread-7:2". The test timeout is 15_000./home/byk/Code/opencode-v2-pilot/packages/core/test/plugin/host.ts builds a complete default Plugin.Context whose unused methods die with explicit "unused ..." errors; default app metadata is { name: "test", version: "test", channel: "test" }, and default location is project-global "/workspace".agentHost(agent) adapts the core Agent.Interface to plugin-facing string IDs: it converts IDs with Agent.ID.make, exposes reload, maps editor values through agentInfo, supports default selection, and copies plugin-side mutations back while rebranding current.id.catalogHost(catalog) and integrationHost(integration) adapt plugin-facing string identifiers into branded Provider.ID, Model.ID, Model.Family, Model.VariantID, Integration.ID, Integration.MethodID, and Credential.ID values; OAuth authorize/refresh callbacks rebuild returned credentials with branded methodID.webSearchHost(websearch) uses fixed location /tmp/websearch-test with project ID "websearch-test" and adapts optional query provider IDs through WebSearch.ID.make./home/byk/Code/opencode-v2-pilot/packages/plugin/src/app.ts defines App with readonly string fields name, version, and channel./home/byk/Code/opencode-v2-pilot/packages/schema/src/location.ts defines Location.Ref as directory: AbsolutePath plus optional workspaceID; Location.Info adds project { id: ProjectID, directory: AbsolutePath, canonical: AbsolutePath }; response(S) wraps data as { location: Info, data: S }./home/byk/Code/opencode-v2-pilot/packages/core/src/plugin.ts maintains one Slot per requested plugin definition in activation order, including failed setup slots, so prefix diffing remains index-aligned and a failed revision is not retried until its revision changes.Semaphore, a Latch initially open, a pending token set, and holdUnsafe()/hold(); acquiring the first hold closes readiness, releasing the final token reopens it, and holds become no-ops after closure.Plugin.activate() rejects duplicate plugin IDs with Effect.die(new Error(\Duplicate plugin ID: ${definition.id}`)); it compares requested definitions to current slots by ordered (id, revision)` pairs and preserves only the unchanged prefix because registrations are setup-ordered.Plugin.activate(): it records the new setup error, attempts to reload a healthy prior activation as fallback, retains that fallback activation while associating it with the requested definition if restoration succeeds, and logs "failed to restore plugin; deactivating" if restoration also fails.load() forks an activation scope, inherits state, groups state-transform failures, and runs plugin.effect({ ...host, storage: PluginHost.storage(kv, plugin.id) }) in that scope with span "Plugin.load" and attribute "plugin.id".Activation with error text Plugin disabled after ${failure.state}.transform failed. Check server logs for details. and a random err_${crypto.randomUUID().slice(0, 8)} ref, then queues a PendingFailure containing the plugin, scope, failure, refresh effect, ref, and readiness-hold release."failed to load plugin", and stores Cause.pretty(exit.cause); a transform-disabled activation remains represented as failed through its shared Activation snapshot."disabled plugin after transform failure", updates inventory under the activation lock, runs State.batch(item.refresh), publishes Plugin.Event.Updated, and separately logs "failed to refresh state after disabling plugin" if refresh fails.Effect.ensuring(...) via Scope.close(item.scope, Exit.void).pipe(..., Effect.forkScoped({ startImmediately: true })), including when a Plugin.Event.Updated observer fails; cleanup errors log "failed to clean up disabled plugin", reporting errors log "failed to report disabled plugin", and item.release runs in a final Effect.ensuring.closed = true, clears pending readiness tokens, opens the readiness latch, clears active slots, and performs State.shutdown(Scope.close(scope, exit)).slotInfo() reports a failure from slot.activation?.failure first, otherwise from slot.error; state is either { status: "active" } or { status: "failed", ...failure }, source defaults to { type: "builtin" }, and features default-merge as { server: true, ...slot.plugin.features }.