You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chat.message plugin hook: SyncEvent.run: "sessionID" required but not found when pushing to output.parts #23440
Plugins that push a text part to output.parts from inside a chat.message hook intermittently crash with:
error: SyncEvent.run: "sessionID" required but not found: {"part":{"type":"text","text":"..."},"time":<epoch>}
at wl (/$bunfs/root/chunk-ng0j12f1.js:491:37371)
at ~effect/Effect/evaluate (/$bunfs/root/chunk-3p3b82m7.js:25:4492)
at runLoop (/$bunfs/root/chunk-3p3b82m7.js:25:2045)
Synchronous pushes appear fine; pushes after an await (network fetch here) race a closed session scope and SyncEvent.run fails because the emitted part has no sessionID.
We encountered exactly this. Beyond the sessionID crash: in some OpenCode builds, chat.message doesn't fire at all — the trigger("chat.message", ...) call site is missing from the session processor entirely. We loaded a plugin with a chat.message hook, the plugin loaded without errors ("loading plugin" in logs), but the hook was never called.
Workaround: use the event hook instead. Listen for message.part.updated bus events:
event: async({ event })=>{if(event.type==="message.part.updated"){consttext=event.properties.part.text// text has the full part content for TextPart/ReasoningPart}}
Also: Bun's fetch() ignores tls: { rejectUnauthorized: false }. Use new https.Agent({ rejectUnauthorized: false }) from node:https for plugins calling HTTPS endpoints with self-signed certs.
Related: #22831 (feature request to expose body to chat.message), #29022 (our findings)
Activity
doobidoo commentedon May 23, 2026
We encountered exactly this. Beyond the
sessionIDcrash: in some OpenCode builds,chat.messagedoesn't fire at all — thetrigger("chat.message", ...)call site is missing from the session processor entirely. We loaded a plugin with achat.messagehook, the plugin loaded without errors ("loading plugin" in logs), but the hook was never called.Workaround: use the
eventhook instead. Listen formessage.part.updatedbus events:Also: Bun's
fetch()ignorestls: { rejectUnauthorized: false }. Usenew https.Agent({ rejectUnauthorized: false })fromnode:httpsfor plugins calling HTTPS endpoints with self-signed certs.Related: #22831 (feature request to expose body to chat.message), #29022 (our findings)
github-actions commentedon Jul 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.