fix(tui): clear stale streaming status for completed unbound runs#64842
fix(tui): clear stale streaming status for completed unbound runs#64842briandevans wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR fixes a TUI bug where the Confidence Score: 5/5Safe to merge — the fix is narrowly scoped and the concurrent-run regression tests still pass. All findings are P2. The logic is correct: both new checks are evaluated after the finalized run is removed from sessionRuns and activeChatRunId is cleared, so no early false-positive idle transition is possible during concurrent runs. The terminateRun asymmetry is a pre-existing gap explicitly out of scope. No files require special attention.
|
|
Closing this because it appears blocked/unlikely to merge in its current state, and I’m preparing a narrower fresh attempt instead. |
Summary
Describe the problem and fix in 2–5 bullets:
streamingafter a run finishes if that run never bound asactiveChatRunId.finalizeRun()now falls back to the terminal status when no tracked runs remain, and empty local/btwfinals use the same idle recovery path.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause (if applicable)
streaming, but the terminal status transition only fired whenwasActiveRunwastrue; local/btwruns can stream without ever binding as the active run, and their empty final path never had a fallback idle transition./btwrun that renders delta text and then finishes with an empty final event.handleChatEvent()intentionally skips bindingactiveChatRunIdfor local/btwruns, so the edge case only appears on that unbound completion path.Regression Test Plan (if applicable)
src/tui/tui-event-handlers.test.ts/btwrun emits a visible delta, then completes with an empty final event, and the TUI status returns fromstreamingtoidle.User-visible / Behavior Changes
/btwpath now return the status bar toidleinstead of leaving it stuck onstreaming.Diagram (if applicable)
Security Impact (required)
Yes/No) NoYes/No) NoYes/No) NoYes/No) NoYes/No) NoYes, explain risk + mitigation:Repro + Verification
Environment
/btwevent-handler pathSteps
/btwso it does not bindactiveChatRunId.streaming.Expected
idleonce the final event is processed.Actual
streaming.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
statusCalls: ["streaming"]) and after the fix (statusCalls: ["streaming", "idle"]); ranpnpm test src/tui/tui-event-handlers.test.ts,pnpm build, andpnpm check.src/tui/tui-event-handlers.test.tsstill passes, so another active run does not get forced toidle.Review Conversations
Compatibility / Migration
Yes/No) YesYes/No) NoYes/No) NoRisks and Mitigations
streamingtoo early if another run were still in flight.