From a32dee75dd406de4b619d5ce64faad875d16c822 Mon Sep 17 00:00:00 2001 From: Sawyer Date: Fri, 18 Sep 2026 09:37:08 -0700 Subject: [PATCH] fix(tui): abort compact on quit, reset lifecycle on failed rebuild Quit no longer parks behind a hung summary call. A failed rebuild un-poisons the compaction lifecycle so later compacts work. CL-8564, CL-8565. --- src/tui/runner/exit.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tui/runner/exit.ts b/src/tui/runner/exit.ts index 9a4070d9e..b02cd6d18 100644 --- a/src/tui/runner/exit.ts +++ b/src/tui/runner/exit.ts @@ -625,6 +625,9 @@ export async function createRunLifecycle( } catch (err) { recordRunError(state, err); state.fatalBuildError = agentRebuildFailure(err); + // A failed rebuild never reaches onBuilt/reset: un-poison the + // lifecycle here so later compacts work instead of silently no-op. + state.compactionLifecycle?.reset(); } }, }); @@ -742,6 +745,8 @@ export async function createRunLifecycle( recordRunError(state, err); state.fatalBuildError = err instanceof Error ? err : new Error(String(err)); + // Same poison guard as the interrupt rebuild above. + state.compactionLifecycle?.reset(); } }); }; @@ -774,6 +779,9 @@ export async function finalizeTUIRun( error: err instanceof Error ? err.message : String(err), }); } + // Quit must not park behind a hung summary call: abort the compact first + // (no notice — quitting needs no commentary), then await the tail. + state.compactionLifecycle?.abortCompaction("quit"); await services.sessionOps.awaitTail(); state.stopFleetReporting?.();