Dashboard › opencode › Promise plugin registration and follow-…
01a0a559-3988-798e-9f7b-2d0bcdd69aa8Define Promise plugins with Plugin.define({ id, setup }) and register related tools in one awaited ctx.tool.transform. Executors must be async and return Promise<{ output?, content?, metadata? }>; direct model tools use options: { codemode: false } without pinned. Follow-up tools must fail closed for subagents, including when lineage lookup fails, because deferred prompts never reach their orchestrator. Subscribe with ctx.event.subscribe({ signal }); on session deletion or unload, abort subscriptions, clear timers/cache, release resources, and dispose registrations. Timers are non-durable: durable recovery requires ctx.storage, startup reconstruction, and stable msg_ IDs.