Repository navigation
Conversation
`batch-executor.ts` never passed the `spinner` argument to
`executePhaseWithRetry`, making `TTYRenderer.pause()` / `resume()` dead
code under `--verbose`. The live zone redraw collided with streaming
Claude SDK text.
- Move `PhasePauseHandle` from `phase-executor.ts` into
`workflow/types.ts` so the cli-ui layer can implement it without the
workflow layer reaching back into cli-ui.
- `BaseRenderer implements PhasePauseHandle` — pure type assertion;
`pause()` / `resume()` already had the correct semantics
(`onPause` → `logUpdateClear`, `onResume` → `redraw`).
- Thread `phasePauseHandle?` through `RunInit` → `OrchestratorConfig` →
`BatchExecutionContext` → `IssueExecutionContext`, mirroring the
existing `onProgress` plumbing.
- Pass the handle at all three `executePhaseWithRetry` call sites in
`batch-executor.ts` (spec, phase loop, /loop).
- Wire `phasePauseHandle: renderer ?? undefined` at the `run.ts`
composition root for both the TUI and standard paths. Quiet / TUI
modes naturally fall through with `undefined`.
- Tests:
- AC-1: handle forwarded at spec / exec / qa / loop call sites
(`batch-executor.test.ts`).
- AC-2: pause precedes the first stdout chunk; resume runs after the
driver returns; debounced to a single pair per phase; stderr path
also triggers pause; quiet mode never calls either
(`phase-pause-handle.test.ts`).
- AC-4: driver receives `onOutput`, isolating the SDK-boundary wiring
assertion.
- AC-3 substitute (automated): the AC-2 ordering test asserts the
`logUpdateClear` → driver-output → `redraw` sequence via the
`pause` / `resume` recorder.
Entire-Checkpoint: eba281a09bec
Closed
4 tasks
This was referenced May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
batch-executor.tsnow passes aPhasePauseHandletoexecutePhaseWithRetryat all three call sites (spec, phase loop, /loop) — the renderer'spause()/resume()protocol was dead code in production because the optional argument was alwaysundefined.--verbose, the live zone now clears (logUpdateClear()) before SDK output streams in and redraws after the agent call completes, eliminating the visual collision between the 1Hz frame and verbose subprocess text.PhasePauseHandlemoved fromphase-executor.tsintoworkflow/types.ts;BaseRendererimplements it directly (no factory).Pre-PR AC Verification
batch-executor.tsat all three call sites passes aPhasePauseHandlederived from the activeTTYRenderersrc/lib/workflow/batch-executor.ts:549,:815,:968; verified by tests inbatch-executor.test.ts("#656 AC-1")renderer.pause()before subprocess execution starts andrenderer.resume()afterphase-pause-handle.test.ts(pause → driver-end → resume)spinner.pausewas called when verbose output is generatedphase-pause-handle.test.ts"#656 AC-2/AC-4" group — exercises realexecutePhasewith a mocked driverFiles Changed
src/lib/workflow/types.ts—PhasePauseHandledefinition + threaded throughBatchExecutionContext,IssueExecutionContextsrc/lib/workflow/phase-executor.ts— importPhasePauseHandlefromtypes.tsinstead of defining locallysrc/lib/workflow/run-orchestrator.ts—RunInit+OrchestratorConfiggainphasePauseHandle?; threaded throughexecuteOneIssuesrc/lib/workflow/batch-executor.ts— destructurephasePauseHandlefrom context; pass as the spinner argument at all threeexecutePhaseWithRetrycall sitessrc/lib/cli-ui/run-renderer.ts—BaseRenderer implements PhasePauseHandlesrc/commands/run.ts— passphasePauseHandle: renderer ?? undefinedfor both TUI and standard pathssrc/lib/workflow/phase-pause-handle.test.ts— new test file (5 cases) covering AC-2 / AC-3 / AC-4src/lib/workflow/batch-executor.test.ts— new "fix(cli): renderer pause/resume is dead code — batch-executor never passes spinner argument #656 AC-1" describe block (3 cases) covering handle forwarding at all sitesCHANGELOG.md—[Unreleased] / FixedentryTest plan
npm run build— passesnpm run lint— passesnpx vitest run src/lib/workflow/ src/lib/cli-ui/ src/commands/— 1264/1266 pass; the 1 failure (prompt-wait.test.tsENOENT race) exists onmainand is unrelated to this PRonOutputcallback that firesspinner.pauseon first chunknpx sequant run <issue> --verbose(HITL — deferred per /spec; automated substitute covers the assertion)Notes
phase-pause-handle.test.tsasserts the pause → driver-output → resume sequence. The optional manual transcript is left for follow-up if desired.implements PhasePauseHandle) rather than agetPhasePauseHandle()factory, matching the design preference in the /spec comment (renderer'spause/resumealready match the shape).executePhaseWithRetry'sspinnerparameter name is preserved to minimize churn; new code refers to it asphasePauseHandleat the call-site level.Closes #656