forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Problem
When PM dispatches a task to a subagent, the UX is broken:
- No visual feedback during task — User sees blank screen for 10+ seconds, then static text for minutes
- No subagent tool output — Child session's tools don't render
- Task completion doesn't auto-wake PM — User has to manually prompt ("any luck?") to see results
Root Cause
Issue 1 & 2: sessionId timing
In task.ts, ctx.metadata({ sessionId }) is called AFTER session creation (line 222-228).
But in index.ts, we look for chunk.metadata?.sessionId during tool_start.
The tool_start event fires BEFORE ctx.metadata() is called, so sessionId is undefined.
Issue 3: Auto-wakeup not triggering UI update
Session.enableAutoWakeup() is called (line 317 in task.ts), but the CLI doesn't seem to respond to it.
Timeline
tool_start fires → metadata.sessionId = undefined → taskToChildSession not set
↓
ctx.metadata() called → sessionId now available → but we don't update the map
↓
child session tools fire → taskToChildSession lookup fails → tools not rendered
↓
task completes → auto-wakeup triggered → CLI doesn't update display
↓
user has to type "any luck?" to see results
Requirements
- Task dispatch shows immediately (agent name, description)
- Child session tools render nested under the task
- Task completion auto-updates the display (no manual prompt needed)
- No 10+ second blank screen
Files
packages/opencode/src/tool/task.ts— Where metadata is setpackages/opencode/src/cli/lite/index.ts— Where we try to read itpackages/opencode/src/cli/lite/liveblock.ts— Task rendering
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels