@@ -6,7 +6,7 @@ import type { KeyEvent } from "@opentui/core"
66import type { CostSummary } from "../cost/cost-summary.js"
77import type { SubAgentSession } from "../subagent/session-store.js"
88import { createHarness } from "./harness.js"
9- import { acceptOverlaySelection , closeInsetOverlay , runOverlayAction , toggleTasksPanel } from "./shell.js"
9+ import { acceptOverlaySelection , closeInsetOverlay , runOverlayAction } from "./shell.js"
1010import {
1111 mountRunnerHost ,
1212 observeSessionFromSubAgents ,
@@ -129,19 +129,11 @@ describe("observeSessionFromSubAgents", () => {
129129} )
130130
131131describe ( "mountRunnerHost chrome wiring" , ( ) => {
132- // CL-5731: the task-change callback was built (director writes tasks,
133- // getTasks()/onTasksChange exist) but had no live consumer — the chrome
134- // push mechanism type-checked fine with `subscribeChrome` omitted, so a
135- // director's task update never reached the shell. `subscribeChrome` is now
136- // a required dep (not optional) so that regression cannot type-check
137- // again, but the type alone does not prove the wiring actually runs: this
138- // test drives a real notify() call through mountRunnerHost end to end and
139- // asserts the task panel painted from it, the way the real runner's
140- // `emitter.emit("tasks", ...)` -> `subscribeChrome` -> `pushChrome` chain
141- // does. If `subscribeChrome`'s notify callback were ever dropped again
142- // (e.g. `deps.subscribeChrome?.(pushChrome)` silently no-op on undefined),
143- // this test fails because the second push never reaches the panel.
144- test ( "a live chrome push (subscribeChrome notify) repaints the task panel" , async ( ) => {
132+ // CL-5731: subscribeChrome must stay wired end-to-end. formatChromeZones
133+ // now parks both chrome strips (always null), so a tasks push must not
134+ // paint the checklist — this test asserts the notify path still runs and
135+ // leaves the task panel empty (rebuild later; live work is ● Task rows).
136+ test ( "a live chrome push (subscribeChrome notify) does not auto-paint the task panel" , async ( ) => {
145137 const harness = await createHarness ( { width : 80 , height : 24 } )
146138 let liveTasks : readonly { title : string ; status : "todo" | "doing" | "done" | "cancelled" } [ ] = [ ]
147139 let notify : ( ( ) => void ) | undefined
@@ -168,20 +160,17 @@ describe("mountRunnerHost chrome wiring", () => {
168160 expect ( host . shell . taskBox . visible ) . toBe ( false )
169161 expect ( notify ) . toBeDefined ( )
170162
171- // Mirrors createChatDirector's onTasksChange firing after a
172- // manage_tasks tool call: the live source changes, then the runner
173- // notifies the host — it does not push the new snapshot itself.
163+ // Mirrors createChatDirector's onTasksChange: live source changes, then
164+ // the runner notifies the host. formatChromeZones parks the checklist.
174165 liveTasks = [ { title : "wire task panel" , status : "doing" } ]
175166 notify ?.( )
176167
177- // CL-5847: the panel is hidden by default, so the live push lands in
178- // tasksRaw underneath without showing. It stays hidden until opt-in.
179168 expect ( host . shell . taskBox . visible ) . toBe ( false )
180- toggleTasksPanel ( host . shell )
181- expect ( host . shell . taskBox . visible ) . toBe ( true )
182169 await harness . renderOnce ( )
183170 const frame = harness . captureCharFrame ( )
184- expect ( frame ) . toContain ( "wire task panel" )
171+ expect ( frame ) . not . toContain ( "wire task panel" )
172+ // Notify callback stayed registered — subscribe path ran without error.
173+ expect ( notify ) . toBeDefined ( )
185174 } finally {
186175 host . dispose ( )
187176 harness . destroy ( )
0 commit comments