Dashboard › opencode › Distillation
a32d181f-0320-4078-8f80-775ccf9ff872["lore_tm_v1_Y5WL3Hjh0QBcmMg2PgK-8gsVc68oqpKKHC78KBUmwZo","lore_tm_v1_89722i5LIoCaszb5TqL1mB4NY2LTTCoPkX-IN-DVnrg"]
/home/byk/Code/opencode/packages/opencode/src/session/prompt.ts lines 99, 1105, 1117, 1120, 1121, 1124, and 1125; /home/byk/Code/opencode/packages/opencode/src/session/processor.ts lines 295 and 603; /home/byk/Code/opencode/packages/opencode/src/session/message-v2.ts lines 326 and 357./home/byk/Code/opencode/packages/opencode/src/session/prompt.ts:99 identifies an interrupted part when part.state.status === "error" && part.state.metadata?.interrupted === true; lines 1105-1125 discuss ignoring cleanup-marked interrupted orphans and warning on loop exit with an orphaned interrupted tool, including orphan.tool and orphan.callID./home/byk/Code/opencode/packages/opencode/src/session/processor.ts:295 says orphan deltas with no preceding reasoning-start are silently dropped to match dev behavior; line 603 sets metadata: { ...metadata, interrupted: true }./home/byk/Code/opencode/packages/opencode/src/session/message-v2.ts:326 preserves part.state.metadata.output only when part.state.metadata?.interrupted === true; line 357 uses the exact error text "[Tool execution was interrupted]"./home/byk/Code/opencode/packages/opencode/src/effect/instance-state.ts defines InstanceState<A, E = never, R = never> with type marker ~opencode/InstanceState and cache: ScopedCache.ScopedCache<string, A, E, R>./home/byk/Code/opencode/packages/opencode/src/effect/instance-state.ts, context reads InstanceRef and dies with new Error("InstanceRef not provided") when absent; workspaceID resolves (yield* WorkspaceRef) ?? WorkspaceContext.workspaceID; directory maps context to ctx.directory.make() in /home/byk/Code/opencode/packages/opencode/src/effect/instance-state.ts:26-45 creates a ScopedCache keyed by string with capacity: Number.POSITIVE_INFINITY; its lookup initializes state via init(yield* context). It registers a directory disposer that runs ScopedCache.invalidate(cache, directory) via Effect.runPromise, and adds a finalizer that unregisters the disposer with Effect.sync(off)./home/byk/Code/opencode/packages/opencode/src/effect/instance-state.ts provides directory-keyed state operations: get() calls ScopedCache.get(self.cache, yield* directory), use() maps a selector over get(self), useEffect() flat-maps an effectful selector, has() calls ScopedCache.has, and invalidate() calls ScopedCache.invalidate; the module exports InstanceState via export * as InstanceState from "./instance-state".