forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
When background tasks complete in oclite, there's no notification or auto-delivery of results. Works in TUI, broken in oclite.
Root Cause
oclite's chat() generator creates a scoped Bus subscription that only lasts for ONE user prompt. When auto-wakeup fires via SessionPrompt.prompt(), nobody is listening to render the response.
TUI works because it has a global reactive event listener that's ALWAYS subscribed.
Fix
Add a persistent subscriber for task completion events in index.ts:
Bus.subscribe(Session.BackgroundTaskEvent.Completed, (event) => {
if (event.properties.parentSessionID !== currentSessionID) return
// Re-subscribe and stream the auto-wakeup response
})Files
src/cli/lite/index.ts— add persistent subscribersrc/session/index.ts:448-509—enableAutoWakeup()reference
Acceptance Criteria
- Task completion triggers notification in oclite
- Results auto-deliver like in TUI
Metadata
Metadata
Assignees
Labels
No labels