forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
Task status line shows → --- but NEVER updates with actual child tool names (e.g., → bash git log). Works in TUI, broken in oclite. Attempted 15+ times to fix.
Root Cause (Definitive)
Two compounding issues:
1. chat() filters events to parent session only
session.ts:60: if (part.sessionID !== sessionID) return
Child session tool events never reach the streaming code path.
2. block.freeze() called when text arrives
index.ts:521: When prose text arrives, block.freeze() is called which:
- Stops animation
- Calls
logUpdate.done()finalizing the output - Subsequent
setTaskChildTool()callsrender()but the block is no longer live
The sequence:
- Task starts →
block.taskStart()→ shows→ --- - LLM outputs text →
block.freeze()→ block finalized - Child tool fires → Bus subscription calls
setTaskChildTool()→ render creates new output, doesn't update existing task line - User sees
→ ---forever
TUI Comparison
TUI uses SolidJS reactive store — task components re-render automatically when child data changes. No "freeze" concept.
Fix Options
Option A: Don't freeze block while tasks are running
if (chunk.type === "text" && chunk.content) {
const hasRunningTasks = [...tasks.values()].some(t => t.status === "running")
if (!hasRunningTasks) block.freeze()
// ...
}Option B: Separate task status rendering from live block
- Keep task status in a separate line that updates independently
- Don't use logUpdate for tasks
Option C: Re-architecture like TUI
- Global reactive event subscription
- Components update independently
Files
src/cli/lite/index.ts— freeze logic, Bus subscriptionsrc/cli/lite/liveblock.ts— freeze(), setTaskChildTool()src/cli/lite/session.ts:60— session filtering
Acceptance Criteria
- Task status line updates with actual child tool names
- Works even when LLM outputs text while task is running
Metadata
Metadata
Assignees
Labels
No labels