fix(engine): stop tears down in-progress merger and triager sessions

TriageProcessor.stop() previously only halted the polling loop, so
in-flight specify sessions and their reviewer subagents kept streaming
past shutdown. Extracted the existing global-pause teardown into
abortAndDisposeActiveSessions() and call it from stop() too.

aiMergeTask creates three sessions during a merge — autostash resolver,
in-merge verification fix agent, and pull-rebase conflict resolver — but
only the autostash one was registered via onSession. The other two are
now registered (with onSession threaded through pushToRemoteAfterMerge
into the rebase resolver chain), so ProjectEngine.stop() actually
disposes whichever merger session is running when shutdown lands.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-05-06 00:04:13 -07:00
parent f65f1a16a3
commit b2aed0fd42
3 changed files with 81 additions and 24 deletions

View File

@@ -0,0 +1,19 @@
---
"@runfusion/fusion": patch
---
Engine stop now tears down in-progress merger and triager agent sessions
that previously kept streaming past shutdown.
**Triager**: `TriageProcessor.stop()` previously only halted the polling
loop, leaving any in-flight specify session and its reviewer subagents
streaming LLM tokens and tool calls past shutdown. It now aborts and
disposes them via the same path the global-pause handler uses.
**Merger**: `aiMergeTask` creates up to three distinct agent sessions
during a merge — autostash conflict resolver, in-merge verification fix
agent, and pull-rebase conflict resolver — but only the autostash session
was registered via `onSession` for the engine to track. The fix-agent and
rebase-resolver sessions are now also registered, so
`ProjectEngine.stop()` actually disposes whichever merger session is
running when shutdown lands.