FN-5752: flush merger agent logs before disposing sessions

Ensure merger AI activity is persisted to task logs before sessions are torn down.

- Flush AgentLogger output in merger AI-session finally blocks for autostash conflict resolution, autostash hard-fail recovery, and rebase conflict resolution paths
- Guard flush/dispose cleanup with safe try/catch handling to avoid teardown-time logging loss
- Add a regression test asserting logger flush occurs before session disposal during AI rebase conflict resolution
- Export the rebase conflict resolver helper for targeted test coverage
- Add a patch changeset for @runfusion/fusion documenting the agent-log visibility fix

Files changed:
 .changeset/fn-5752-merger-log-flush.md             |  5 ++++
 packages/engine/src/__tests__/merger-conflict-resolution.test.ts   | 30 ++++++++++++++++++++++
 packages/engine/src/merger.ts                      | 22 +++++++++++++++-
 3 files changed, 56 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5752

Fusion-Task-Lineage: 3c6023f0-cc9b-47e1-bfd4-69b40e011d84
This commit is contained in:
gsxdsm
2026-05-30 15:06:04 -07:00
parent 1594470144
commit 292bf07385
3 changed files with 56 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@runfusion/fusion": patch
---
Fix merger agent-log visibility by flushing buffered `AgentLogger` output before disposing AI sessions used for autostash conflict resolution, autostash hard-fail recovery, and rebase conflict resolution. This ensures trailing text/thinking deltas are persisted so merger activity reliably appears in the task agent log panel.