forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
Subagent activity streaming is not working in real-time. Users only see brief flashes of activity status.
Root Cause Analysis
How it's supposed to work:
Taskcomponent displays subagent activity viasync.data.message[childSessionId]- Events should update the sync store in real-time
- Activity extracted from message parts shows current tool/operation
What's broken:
-
Missing
message.updatedevents for child sessions- Child sessions emit
message.part.updatedevents (parts stored correctly) - Child sessions emit
message.createdevents - BUT
message.updatedevents are NOT being emitted when messages are updated - The sync context only adds messages to
sync.data.message[sessionID]onmessage.updatedevent
- Child sessions emit
-
Activity display relies on manual sync
- Child messages only appear via explicit
sync.session.sync()API call - No REAL-TIME streaming of child session activity
- Events arrive but messages aren't added to the store
- Child messages only appear via explicit
Key Files
packages/opencode/src/cli/cmd/tui/routes/session/index.tsx- Task component (~line 1800)packages/opencode/src/cli/cmd/tui/context/sync.tsx- Sync context event handlingpackages/opencode/src/session/index.ts-updateMessagefunction (~line 400)
Recommended Fix
-
Ensure
message.updatedevents are emitted for child sessions when messages are created/updated- Verify
Session.updateMessageis called during child session processing - Ensure event emission happens on every message change
- Verify
-
Alternative: Direct event subscription in Task component
- Have Task component subscribe to SDK events for its child session
- Update local state on
message.part.updatedevents - Bypasses sync context dependency
Related
- [UI] Subagent status line flickers and causes layout jumping #36 UI flicker (fixed) - was a symptom of this issue
Priority
High - affects UX when running parallel agents
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels