DashboardopencodePromise plugin registration and follow-…

Promise plugin registration and follow-up scheduler

Category: pattern
Confidence: 1.00
ID: 01a0a559-3988-798e-9f7b-2d0bcdd69aa8
Project ID: c0425955-02bc-4c17-9af2-b114c00077e7
Cross-project: No
Recalled in other projects: 0
Source session: 0HuHToru7i88dEfLq
Created: 2026-07-19 16:22:02
Updated: 2026-09-15 13:54:43

Content

Define 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.

Move to: