Commit Graph

4512 Commits

Author SHA1 Message Date
gsxdsm
8fdadb0795 fix(cli): push per-task branch to origin before creating PR; drop dead autoCreatePr
In PR-mode, processPullRequestMergeTask called gh pr create --head
fusion/<task-id> without ever pushing the branch to origin. PR creation
failed and the task stalled in in-review — and combined with the
recover-mergeable-review sweep bug, the stalled task got force-merged
locally instead. Push the branch via git push -u origin <branch>
immediately before createPr (skipped when an existing PR already covers
the branch).

Also remove the dead autoCreatePr setting: defined as a default in the
schema and Settings type but never read anywhere.

Related to https://github.com/Runfusion/Fusion/issues/21

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:42:17 -07:00
gsxdsm
66d2c86265 fix(remote): derive tailscale target port from server-side request
Override the stored tailscale targetPort in the start handler using the
actual port the start request landed on (req.socket.localPort), instead
of trusting a value the browser supplied. window.location.port can be
wrong behind a reverse proxy, ssh forward, or split deployment, and
silently funneling the wrong process is worse than the prior
"port-not-configured" error.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:39:08 -07:00
gsxdsm
f9260f2c65 feat(dashboard): auto-detect tailscale target port; clearer scan block
* Drop the Target port field from Settings — the dashboard already knows
  what port it's serving on, so use window.location.port (falling back
  to 80/443 by protocol). A user-overridable port adds no value and a
  stale stored value silently misroutes the funnel.
* Restructure the running-tunnel scan block to show three rows: the
  raw tailnet URL, the remote access code (rt= token, separate), and
  the QR image. Previously the auth URL was rendered as one long string
  that read as "the bare hostname" when truncated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:33:13 -07:00
Fusion
c9cdef720d feat(FN-2932): improve active agent visibility and grouped tool-call UX
- Preserve and emphasize active agent card highlights across hover and modal states, with dedicated CSS updates and regression tests
- Expand dashboard and TUI activity surfaces for grouped tool-call and live agent status/log visibility, including Quick Chat and chat view refinements
- Add route and runtime updates for agent/settings flows plus self-healing coverage for merge recovery behavior
- Include accompanying changesets and test stabilizations for mission activity assertions and active highlight hooks

Fusion-Task-Id: FN-2932
2026-04-29 13:29:00 -07:00
Fusion
07ca2ae668 feat(FN-2926): merge fusion/fn-2926
- Chat grouped tool calls refactored out of `ChatToolCalls.tsx` into inline rendering in `ChatView.tsx`, with updated styling and new tests; summary/expand logic for grouped calls updated
- New `QuickChatFAB` component added with styles, replacing the old `ChatToolCalls` inline callout with a persistent quick-access button
- Settings modal enhanced with agent runtime routes (register/unregister, run management) and memory settings routes (export, update limits)
- Remote access provider adapters updated to support real QR codes and live Tailscale URL sharing in TUI dashboard
- TUI dashboard app/controller/state updated to surface remote node status and shortcut hints
- `AgentsView` component updated with new layout and styling, plus comprehensive tests
- Route registration and agent runs tests updated to match new runtime API shape
- `surface-hover` fallback assertion aligned across tests
- Bundled dependency updates in `pnpm-lock.yaml`

Commits merged:
- test(FN-2926): align surface-hover fallback assertion
- feat(FN-2926): complete Steps 2-4 — inline grouped tool-call rendering and tests
- feat(FN-2926): complete Step 3 — refine grouped tool-call styles
- feat(FN-2926): complete Step 1 — update grouped tool call summary logic
- feat(remote): real QR codes, live tailscale URL, TUI status & shortcut
- feat(FN-2931): merge fusion/fn-2931
- feat(FN-2925): merge fusion/fn-2925
- feat(FN-2903): merge fusion/fn-2903

Files changed:
.../commands/dashboard-tui/__tests__/app.test.tsx  |   9 +-
 packages/cli/src/commands/dashboard-tui/app.tsx    |  97 +++++++++++--
 .../cli/src/commands/dashboard-tui/controller.ts   |  31 ++++
 packages/cli/src/commands/dashboard-tui/state.ts   |   9 +-
 packages/cli/src/commands/dashboard.ts             |   3 +-
 .../app/__tests__/status-colors-theme.test.ts      |   4 +-
 packages/dashboard/app/components/AgentsView.css   |  20 ++-
 packages/dashboard/app/components/AgentsView.tsx   |  11 +-
 .../dashboard/app/components/ChatToolCalls.tsx     | 160 ---------------------
 packages/dashboard/app/components/ChatView.css     |  53 +++----
 packages/dashboard/app/components/ChatView.tsx     | 131 ++++++++++++++++-
 packages/dashboard/app/components/QuickChatFAB.css |  87 ++++++-----
 packages/dashboard/app/components/QuickChatFAB.tsx | 124 +++++++++++++++-
 .../dashboard/app/components/SettingsModal.css     |  21 +++
 .../dashboard/app/components/SettingsModal.tsx     |  72 +++++++++-
 .../app/components/__tests__/AgentsView.test.tsx   |  37 +++++
 .../app/components/__tests__/ChatView.test.tsx     |  83 +++++++++--
 .../app/components/__tests__/QuickChatFAB.test.tsx |  68 ++++++---
 .../components/__tests__/SettingsModal.test.tsx    |  12 +-
 packages/dashboard/package.json                    |   2 +
 .../src/__tests__/routes-agent-runs.test.ts        |  13 +-
 .../src/routes/register-agent-runtime-routes.ts    |  49 ++++---
 .../src/routes/register-settings-memory-routes.ts  |  36 ++++-
 packages/engine/src/project-engine.ts              |   4 +-
 .../engine/src/remote-access/provider-adapters.ts  |  14 +-
 pnpm-lock.yaml                                     | 113 +++++++++++++++
 26 files changed, 933 insertions(+), 330 deletions(-)

Fusion-Task-Id: FN-2926
2026-04-29 13:26:25 -07:00
gsxdsm
d6556e6f1f chore: add changeset for remote tailscale QR/TUI overhaul
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:26:07 -07:00
gsxdsm
9dde067573 fix(engine): respect autoMerge and mergeStrategy in recover-mergeable-review sweep
The periodic maintenance job `recover-mergeable-review` was silently merging
in-review tasks regardless of `autoMerge` and `mergeStrategy` settings,
defeating the PR-based review flow for users with `autoMerge: false` and
`mergeStrategy: "pull-request"`.

Gate the sweep on `settings.autoMerge` (and globalPause/enginePaused for
consistency with other merge entry points) and route through the engine's
merge queue via the existing `enqueueMerge` callback so `mergeStrategy ===
"pull-request"` is honored. Falls back to the direct `store.mergeTask` path
only when no enqueue callback is wired (standalone/tests).

Closes https://github.com/Runfusion/Fusion/issues/21

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:26:05 -07:00
Fusion
f50c2ce46f feat(FN-2926): enhance grouped tool-call UX across dashboard and TUI
- Inline grouped tool-call rendering in chat surfaces and update summary logic for clearer aggregation
- Refine chat, quick FAB, settings, and agents UI styles/behavior with matching test coverage updates
- Extend dashboard TUI state/controller flow with status and shortcut improvements
- Update engine and dashboard route handling related to agent runs, settings memory sync, and remote access adapters

Fusion-Task-Id: FN-2926
2026-04-29 13:23:31 -07:00
gsxdsm
8bbd956fa5 feat(remote): real QR codes, live tailscale URL, TUI status & shortcut
* Replace placeholder /remote/qr SVG (URL drawn as text) with real QR
  rendered via the qrcode package; add format=terminal returning ASCII
  QR for the TUI.
* Resolve the public tailscale funnel URL from captured CLI output
  instead of constructing http://<hostname>:<port> from a configured
  hostname label — that label was never used by `tailscale funnel` and
  produced a non-public URL in the auth/QR link.
* Drop hostname requirement from engine + UI; only target port matters.
* Tighten tailscale parseReadiness to require a URL on the matched line
  so the tunnel manager doesn't lock in `running` before the URL line.
* TUI: poll remote status, show ● tunnel indicator + URL in MainHeader,
  bind Ctrl+Q to a global QR overlay (terminal ASCII), and switch the
  in-Settings K shortcut to render the same ASCII QR.
* Auto-poll remote status in the dashboard while in `starting`/`stopping`
  so the UI flips to running without reopening the modal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 13:20:03 -07:00
Fusion
72ae0b46bf feat(FN-2931): merge fusion/fn-2931
- **New node routing policy engine** (`packages/engine/src/node-routing-policy.ts`, `scheduler.ts`): introduces configurable routing rules for assigning tasks to specific nodes, with a new test suite covering policy matching, node priority, and capacity constraints
- **Agent run route decoupling** (`register-agent-runtime-routes.ts`): routes now respond before heartbeat side effects complete, improving latency and reducing 503s under load; tests updated to handle async state transitions
- **Scheduler node routing** (`scheduler-node-routing.test.ts`): 131-line test expansion covering task-to-node assignment with routing policies
- **Dashboard UI polish** (AgentsView, QuickChatFAB, SettingsModal): CSS refinements and component adjustments from FN-2903
- **Reviewer and triage refinements** (`reviewer.ts`, `triage.ts`): logic improvements for async execution paths
- **Remote access adapter** (`provider-adapters.ts`): extended from FN-2950
- **Settings memory routes** (`register-settings-memory-routes.ts`): from FN-2925
- **Docs** (`architecture.md`, `settings-reference.md`): updated for new routing policy and settings features

Commits merged:
- test(FN-2931): complete Step 2 — update async state route assertions
- feat(FN-2931): complete Step 1 — respond before heartbeat side effects
- feat(FN-2925): merge fusion/fn-2925
- feat(FN-2903): merge fusion/fn-2903
- feat(FN-2950): merge fusion/fn-2950

Files changed:
docs/architecture.md                               |  19 +--
 docs/settings-reference.md                         |   2 +-
 packages/dashboard/app/components/AgentsView.css   |  20 +++-
 packages/dashboard/app/components/AgentsView.tsx   |  11 +-
 packages/dashboard/app/components/QuickChatFAB.css |  32 ++++-
 .../dashboard/app/components/SettingsModal.css     |  21 ++++
 .../dashboard/app/components/SettingsModal.tsx     |  58 ++++++++-
 .../app/components/__tests__/AgentsView.test.tsx   |  37 ++++++
 .../app/components/__tests__/QuickChatFAB.test.tsx |  18 +--
 .../components/__tests__/SettingsModal.test.tsx    |   2 +-
 packages/dashboard/package.json                    |   2 +
 .../src/__tests__/routes-agent-runs.test.ts        |  13 +-
 .../src/routes/register-agent-runtime-routes.ts    |  49 ++++----
 .../src/routes/register-settings-memory-routes.ts  |   8 +-
 .../src/__tests__/node-routing-policy.test.ts      |  78 ++++++++++++
 packages/engine/src/__tests__/reviewer.test.ts     |  19 ++-
 .../src/__tests__/scheduler-node-routing.test.ts   | 131 ++++++++++++++++++++-
 packages/engine/src/__tests__/triage.test.ts       |  16 +--
 packages/engine/src/node-routing-policy.ts         |  45 +++++++
 .../engine/src/remote-access/provider-adapters.ts  |  14 ++-
 packages/engine/src/reviewer.ts                    |  33 ++++--
 packages/engine/src/scheduler.ts                   |  44 ++++++-
 packages/engine/src/triage.ts                      |  48 ++++----
 pnpm-lock.yaml                                     | 113 ++++++++++++++++++
 24 files changed, 721 insertions(+), 112 deletions(-)

Fusion-Task-Id: FN-2931
2026-04-29 12:56:56 -07:00
Fusion
87d9c1c380 feat(FN-2925): merge fusion/fn-2925
- Mobile header row polish: finalize QuickChatFAB CSS for mobile viewport handling, apply visual viewport height to quick chat panel, remove duplicate keyboard overlap subtraction
- Add `node-routing-policy.ts` with routing logic for mesh network nodes; expand scheduler node-routing tests with new policy coverage
- Improve reviewer decision logic and add reviewer test cases for changed behavior
- Refactor triage module (48 lines changed) with updated agent selection logic
- Update `AgentsView` component and styles; add `AgentsView.test.tsx` integration test
- Simplify `QuickChatFAB.test.tsx` test by removing CSS class permutation coverage
- Update architecture docs and settings reference to reflect new routing capabilities

Commits merged:
- fix(FN-2925): remove duplicate keyboard overlap subtraction
- feat(FN-2925): complete Step 5 — finalize mobile header row polish
- fix(FN-2925): apply visual viewport height to mobile quick chat panel
- feat(FN-2903): merge fusion/fn-2903
- feat(FN-2950): merge fusion/fn-2950

Files changed:
docs/architecture.md                               |  19 +--
 docs/settings-reference.md                         |   2 +-
 packages/dashboard/app/components/AgentsView.css   |  20 +++-
 packages/dashboard/app/components/AgentsView.tsx   |  11 +-
 packages/dashboard/app/components/QuickChatFAB.css |  32 ++++-
 .../dashboard/app/components/SettingsModal.tsx     |   4 +-
 .../app/components/__tests__/AgentsView.test.tsx   |  37 ++++++
 .../app/components/__tests__/QuickChatFAB.test.tsx |  18 +--
 .../src/__tests__/node-routing-policy.test.ts      |  78 ++++++++++++
 packages/engine/src/__tests__/reviewer.test.ts     |  19 ++-
 .../src/__tests__/scheduler-node-routing.test.ts   | 131 ++++++++++++++++++++-
 packages/engine/src/__tests__/triage.test.ts       |  16 +--
 packages/engine/src/node-routing-policy.ts         |  45 +++++++
 packages/engine/src/reviewer.ts                    |  33 ++++--
 packages/engine/src/scheduler.ts                   |  44 ++++++-
 packages/engine/src/triage.ts                      |  48 ++++----
 16 files changed, 473 insertions(+), 84 deletions(-)

Fusion-Task-Id: FN-2925
2026-04-29 12:53:10 -07:00
gsxdsm
ad58a1d445 feat(FN-2903): merge fusion/fn-2903 2026-04-29 12:31:09 -07:00
Fusion
fd4353f026 feat(FN-2950): merge fusion/fn-2950
- Updated routing policy documentation in `docs/architecture.md` and `docs/settings-reference.md`
- Revised docs reflect the latest routing configuration options and behavior

Commits merged:
- feat(FN-2950): complete Step 6 — update routing policy documentation

Files changed:
docs/architecture.md       | 19 ++++++++++---------
 docs/settings-reference.md |  2 +-
 2 files changed, 11 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-2950
2026-04-29 12:17:18 -07:00
Fusion
8dd4999f11 feat(FN-2953): merge fusion/fn-2953
Commits merged:
- merge fusion/fn-2953

Fusion-Task-Id: FN-2953
2026-04-29 12:12:05 -07:00
gsxdsm
822bde7829 test(FN-2360): harden test isolation around repo fusion state 2026-04-29 12:02:56 -07:00
gsxdsm
cecf14a4f1 feat(FN-2922): merge fusion/fn-2922 2026-04-29 12:01:13 -07:00
gsxdsm
8796a32401 fix(dashboard): prefill Tailscale hostname from window.location
Empty hostname triggered provider_not_configured even though the field
was labeled "(optional)". Drop the misleading label and default to the
browser's current hostname so the start action succeeds out of the box.
Also drop the legacy MediaQueryList.addListener fallback to clear the
deprecation warning.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:57:38 -07:00
gsxdsm
a6a8862986 chore: backfill changesets for recent commits
Add changesets covering recent fix/feat commits since v0.8.4 that did
not yet have one: TUI wide layout, TUI log copy feedback, dashboard
merge-base diff, dashboard task-only file diffs, engine concurrency
races, memory dream session-state read, AI-summarized merge commits,
and the FN-2877 task card fallbacks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:53:42 -07:00
gsxdsm
627d1c9606 feat(core,dashboard): allow tasks to be respec'd from in-review
Add `triage` to VALID_TRANSITIONS["in-review"] so the dashboard's
`Request AI Revision` and `Rebuild Spec` actions work for in-review
tasks. moveTask now applies the same full reset on in-review → triage
as on in-review → todo (clears branch/baseBranch/baseCommitSha/summary/
recovery metadata and workflowStepResults) so the respec'd task starts
from scratch. The in-review task card's Move menu also gains Planning
as a destination.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:53:35 -07:00
gsxdsm
601e206f74 fix(FN-2877): restore task card timing and changes fallbacks 2026-04-29 11:42:37 -07:00
Fusion
d6e8915418 feat(FN-2869): merge fusion/fn-2869
- Add pluggable notification provider system with changeset and docs (`@runfusion/fusion` patch)
- Strengthen node routing and task diff visibility (FN-2840): merge-base resolution, routing guards, and unavailable-node policy tests in dashboard
- Overhaul `QuickChatFAB` component: redesigned FAB with modal, chat thread UI, CSS expansion (140 lines added), and comprehensive test coverage
- Rewrite `useQuickChat` hook: switch to polling-based state, expose dismiss/reset, improve retry and error handling
- Fix executor/merger concurrency races and reviewer pause TOCTOU in `packages/engine`
- Add `AgentSemaphore` defensive guards for invalid limits (NaN, Infinity)
- Expand `agent-runtime`, `agent-session-helpers`, `self-healing`, and `triage` engine modules
- Improve TUI: stack utilities/settings under stats in wide layout, add log entry copy feedback
- Add routing and file-diffs test coverage (`routes.test.ts`, `routes-file-diffs.test.ts`)

Commits merged:
- docs(FN-2869): complete Step 2 — document notification provider settings
- chore(FN-2869): add changeset for pluggable notification providers
- feat(FN-2849): merge fusion/fn-2849-2
- feat(tui): stack utilities/settings under stats in wide layout
- fix(engine): close executor/merger concurrency races and reviewer pause TOCTOU
- fix(dashboard): prefer merge-base over outdated baseCommitSha
- fix(tui): surface visible feedback when copying a log entry
- feat(FN-2840): strengthen node routing and task diff visibility
- feat(FN-2910): merge fusion/fn-2910

Files changed:
.changeset/pluggable-notification-providers.md     |   4 +
 docs/settings-reference.md                         |  17 +-
 packages/cli/src/commands/dashboard-tui/app.tsx    |  71 +++++--
 .../cli/src/commands/dashboard-tui/controller.ts   |  18 ++
 packages/cli/src/commands/dashboard-tui/state.ts   |   5 +
 .../core/src/__tests__/node-override-guard.test.ts |  24 +++
 packages/core/src/__tests__/store.test.ts          |  27 +++
 .../core/src/__tests__/task-node-override.test.ts  |  25 +++
 .../src/__tests__/unavailable-node-policy.test.ts  |  42 ++++
 packages/dashboard/app/api/legacy.ts               |   3 +-
 packages/dashboard/app/components/QuickChatFAB.css | 140 ++++++++++++-
 packages/dashboard/app/components/QuickChatFAB.tsx | 226 ++++++++++++++++++++-
 .../app/components/__tests__/QuickChatFAB.test.tsx | 133 +++++++++++-
 .../app/hooks/__tests__/useQuickChat.test.ts       |  12 +-
 packages/dashboard/app/hooks/useQuickChat.ts       | 149 ++++++++------
 .../src/__tests__/routes-file-diffs.test.ts        |  52 +++++
 packages/dashboard/src/__tests__/routes.test.ts    | 177 ++++++++++++++++
 packages/dashboard/src/routes/resolve-diff-base.ts |  76 ++++---
 .../engine/src/__tests__/project-engine.test.ts    |   8 +-
 packages/engine/src/agent-runtime.ts               |  15 ++
 packages/engine/src/agent-session-helpers.ts       |  14 +-
 packages/engine/src/concurrency.ts                 |  37 +++-
 packages/engine/src/executor.ts                    | 183 ++++++++++++-----
 packages/engine/src/pi.ts                          |  11 +
 packages/engine/src/project-engine.ts              |  47 ++++-
 packages/engine/src/reviewer.ts                    |  95 +++++++--
 packages/engine/src/self-healing.ts                |   8 +
 packages/engine/src/triage.ts                      |  10 +-
 28 files changed, 1412 insertions(+), 217 deletions(-)

Fusion-Task-Id: FN-2869
2026-04-29 11:42:25 -07:00
Fusion
736baf3805 feat(FN-2849): merge fusion/fn-2849-2
- **Node routing & diff visibility** (FN-2840, FN-2910): Strengthened node routing with improved task diff visibility; `resolve-diff-base.ts` now prefers `merge-base` over potentially stale `baseCommitSha`; added `unavailable-node-policy` and `node-override-guard` tests
- **Concurrency races fixed**: Executor and merger now synchronize worktree lifecycle more defensively; reviewer pause/unpause fixed against TOCTOU races in `concurrency.ts`
- **Richer merge commit messages**: `merger.ts` and `ai-summarize.ts` enhanced to generate AI-summarized merge messages via the summarizer pipeline
- **Memory dream improvements**: `memory-dreams.ts` reads assistant text from session state when processing dreams; added coverage for undefined output edge cases
- **QuickChatFAB UI**: New floating action button component with chat integration (226 lines TSX, 140 lines CSS); `useQuickChat.ts` refactored for better state management; tests added
- **Task changes display**: `ChangesDiffModal` and `TaskChangesTab` now surface only files actually modified by the task, not the full diff baseline
- **Self-healing hooks**: `self-healing.ts` extended with additional recovery logic for agent runtime
- **Documentation**: Added `docs/multi-project.md` (central registry, isolation modes), `docs/architecture.md` (node settings sync API), `docs/task-management.md` (archive/restore), `docs/cli-reference.md`; updated `docs/settings-reference.md`
- **Gitignore**: Allow committed `.changeset/` directories
- Merged in FN-2734 and FN-2957 as part of this branch

Commits merged:
- test(FN-2849): add node routing route coverage
- fix(engine): close executor/merger concurrency races and reviewer pause TOCTOU
- fix(dashboard): prefer merge-base over outdated baseCommitSha
- fix(tui): surface visible feedback when copying a log entry
- feat(FN-2840): strengthen node routing and task diff visibility
- feat(FN-2910): merge fusion/fn-2910
- fix(dashboard): show only files actually changed by the task
- test(memory): cover dream session-state extraction and undefined output
- fix(gitignore): allow committed changesets
- fix(memory): read assistant text from session state when processing dreams
- feat(merger): generate richer merge commit messages via AI summarizer
- feat(FN-2734): merge fusion/fn-2734
- feat(FN-2957): merge fusion/fn-2957

Files changed:
.gitignore                                         |   5 +
 docs/architecture.md                               |  46 ++++
 docs/cli-reference.md                              |  21 ++
 docs/dashboard-guide.md                            |  10 +-
 docs/multi-project.md                              |  47 ++++
 docs/settings-reference.md                         |  32 ++-
 docs/task-management.md                            |  64 ++++++
 packages/cli/src/commands/dashboard-tui/app.tsx    |  40 +++-
 .../cli/src/commands/dashboard-tui/controller.ts   |  18 ++
 packages/cli/src/commands/dashboard-tui/state.ts   |   5 +
 packages/core/src/__tests__/memory-dreams.test.ts  |  22 ++
 .../core/src/__tests__/node-override-guard.test.ts |  24 +++
 packages/core/src/__tests__/store.test.ts          |  27 +++
 .../core/src/__tests__/task-node-override.test.ts  |  25 +++
 .../src/__tests__/unavailable-node-policy.test.ts  |  42 ++++
 packages/core/src/ai-summarize.ts                  |  34 ++-
 packages/core/src/memory-dreams.ts                 |   7 +-
 packages/dashboard/app/api/legacy.ts               |   3 +-
 .../dashboard/app/components/ChangesDiffModal.css  |   2 +
 .../dashboard/app/components/ChangesDiffModal.tsx  |   5 +-
 packages/dashboard/app/components/QuickChatFAB.css | 140 +++++++++++-
 packages/dashboard/app/components/QuickChatFAB.tsx | 226 +++++++++++++++++++-
 .../dashboard/app/components/TaskChangesTab.css    |   5 +
 .../dashboard/app/components/TaskChangesTab.tsx    |   5 +-
 .../components/__tests__/ChangesDiffModal.test.tsx |  31 +++
 .../app/components/__tests__/QuickChatFAB.test.tsx | 133 +++++++++++-
 .../components/__tests__/TaskChangesTab.test.tsx   |  71 +++++++
 .../app/hooks/__tests__/useQuickChat.test.ts       |  12 +-
 packages/dashboard/app/hooks/useQuickChat.ts       | 149 +++++++------
 .../src/__tests__/routes-file-diffs.test.ts        | 165 ++++++++++++++
 packages/dashboard/src/__tests__/routes.test.ts    | 236 +++++++++++++++++++--
 .../src/routes/register-session-diff-routes.ts     |  54 ++---
 .../src/routes/register-settings-memory-routes.ts  |  23 +-
 packages/dashboard/src/routes/resolve-diff-base.ts |  72 ++++++-
 .../engine/src/__tests__/project-engine.test.ts    |   8 +-
 packages/engine/src/agent-runtime.ts               |  15 ++
 packages/engine/src/agent-session-helpers.ts       |  14 +-
 packages/engine/src/concurrency.ts                 |  37 +++-
 packages/engine/src/executor.ts                    | 183 +++++++++++-----
 packages/engine/src/merger.ts                      |  97 +++++++--
 packages/engine/src/pi.ts                          |  11 +
 packages/engine/src/project-engine.ts              |  47 +++-
 packages/engine/src/reviewer.ts                    |  95 +++++++--
 packages/engine/src/self-healing.ts                |   8 +
 packages/engine/src/triage.ts                      |  10 +-
 45 files changed, 2054 insertions(+), 272 deletions(-)

Fusion-Task-Id: FN-2849
2026-04-29 11:35:01 -07:00
gsxdsm
63f21c3c71 feat(tui): stack utilities/settings under stats in wide layout
Why: at ≥150 cols Stats was lifted next to Logs but Utilities/Settings
sat in a separate bottom row. Keep them stacked under Stats in the left
column so Logs gets the full height on the right; Stats flex-grows to
absorb leftover space while Utilities/Settings stay at fixed heights.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:31:57 -07:00
gsxdsm
800c283e57 fix(engine): close executor/merger concurrency races and reviewer pause TOCTOU
FN-2910 surfaced concurrent reviewer + merger activity on the same task.
Root cause: asymmetric in-flight guards let an unpause-resume kick off a
fresh executor session while a recovery path was already running, and the
auto-merge handoff fired before the executor's finally block finished
cleanup. This sweeps the surrounding lifecycle paths for similar races and
tightens the reviewer pause gate against TOCTOU through runtime setup.

- Symmetric in-flight tracking across `executing`, `recoveringCompleted`,
  and `resumingUnpaused`; `recoverCompletedTask` bails when any are set.
- Atomic claim of the recovery slot in the completed-task watchdog before
  any awaited work.
- Workflow-rerun bounce returns "bounced" | "skipped-pending" so the
  watchdog can no longer log a false-success retry when the original
  bounce is still mid-flight.
- Self-healing's completed-task scan re-checks executing IDs inside the
  loop instead of trusting a pre-await snapshot.
- 300ms grace period before auto-merge enqueue, giving the executor's
  finally block (session disposal, child cleanup) time to drain and
  eliminating the residual log-overlap symptom from FN-2910. Test uses
  fake timers, no real sleep added.
- New AgentSemaphore.runNested for synchronously nested helper agents
  (reviewers): bumps activeCount for honest observability while bypassing
  the wait queue, preserving forward-progress fairness for the parent at
  low maxConcurrent. Both createReviewStepTool and triage's
  createReviewSpecTool now use it.
- New beforeSpawnSession hook on AgentRuntimeOptions/AgentOptions fired
  inside createFnAgent immediately before createAgentSession, past every
  awaited setup step. Reviewer wires a pause re-check that throws a
  sentinel error converted to UNAVAILABLE, closing the TOCTOU window
  where pause flipped during runtime resolution or resource loading.

All 2887 engine tests pass; engine + core + cli + dashboard + plugin-sdk
+ pi-claude-cli + desktop typecheck clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 11:26:39 -07:00
gsxdsm
327ddd613c fix(dashboard): prefer merge-base over outdated baseCommitSha
When a worktree was rebased onto newer main, baseCommitSha remained an
ancestor of HEAD but the range baseCommitSha..HEAD then swept in upstream
main commits as if they were task changes (FN-2840 showed 33 files for a
4-file task). The previous display-recovery only fired when baseCommitSha
was no longer an ancestor, missing this case.

When enableDisplayRecovery is on and baseBranch is missing, also compute
merge-base(HEAD, main) and prefer it when it's a descendant of
baseCommitSha (tighter fork point). When merge-base is not a descendant
(FN-2855: baseCommitSha is on a deleted feature branch), keep
baseCommitSha so we don't widen to unrelated upstream files.

Also stabilizes the card-vs-Changes-tab divergence: resolution no longer
depends on whether a rebase happened between polls.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:29:13 -07:00
gsxdsm
36bc8d0e2a fix(tui): surface visible feedback when copying a log entry
The [c] copy handler was writing a success/failure log entry to the
buffer, but in expanded mode the panel hides the buffer so users got no
indication the copy ran. Add a transient inline "Copied!" flash in both
list and expanded views, and clamp the index to match the display
cursor so the copy never silently misses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:23:55 -07:00
Fusion
b6eb851965 feat(FN-2840): strengthen node routing and task diff visibility
- Expand core test coverage for task node overrides, unavailable node policies, and defaultNodeId settings contracts
- Restrict dashboard task change views to files actually modified by the task, with updated API route handling and tests
- Improve quick chat UX and styling with extended component behavior and hook updates
- Harden memory dream extraction by reading assistant text from session state and covering undefined-output cases
- Enhance merger commit summarization and update architecture/settings/multi-project/task-management docs

Fusion-Task-Id: FN-2840
2026-04-29 10:22:18 -07:00
Fusion
50d194e27b feat(FN-2910): merge fusion/fn-2910
Commits merged:
- merge fusion/fn-2910

Fusion-Task-Id: FN-2910
2026-04-29 10:20:34 -07:00
gsxdsm
7c857c82b5 fix(dashboard): show only files actually changed by the task
Two fixes for the in-review/in-progress "files changed" count on task
cards and the Changes tab:

- Drop untracked files from /tasks/:id/diff and /tasks/:id/file-diffs.
  At review time these are almost always build artifacts/cache/logs not
  in .gitignore, not real task changes, and they inflated the count.
- Add display-only `enableDisplayRecovery` option to resolveDiffBase.
  When a worktree was rebased onto origin/main after baseCommitSha was
  recorded and baseBranch was not set, the prior code fell through to
  HEAD~1 — undercounting to just the last commit's files (e.g. FN-2957
  showed 2 in review, 6 after merge). Recovery now tries
  merge-base(HEAD, main) / origin/main before HEAD~1.

Routes opt into recovery; the merger's mirrored copy
(resolveTaskDiffBaseRef) is intentionally untouched so merge-time
scope warnings still evaluate the strict task base.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:13:39 -07:00
gsxdsm
a555868b74 test(memory): cover dream session-state extraction and undefined output
Update dashboard mocks to push assistant text into session.state.messages
(matching real session.prompt() void return) and add a regression test for
array-shaped content. Add core unit tests for extractDreamProcessorResult
to lock in undefined/null safety.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 10:10:08 -07:00
gsxdsm
aeb384d1e9 fix(gitignore): allow committed changesets 2026-04-29 10:02:04 -07:00
gsxdsm
eae76d2559 fix(memory): read assistant text from session state when processing dreams
session.prompt() resolves to void; the reply lives in session.state.messages.
The dream route was awaiting its return value, so parsing crashed with
"Cannot read properties of undefined (reading 'match')" once the dream
completed. Extract the assistant text post-prompt and fail soft on
non-string input in extractDreamProcessorResult.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 09:59:52 -07:00
gsxdsm
91a05688ee feat(merger): generate richer merge commit messages via AI summarizer
Squash merge commits previously landed with only a bare "merge
fusion/fn-XXXX" subject and a single bullet from the branch's commit
log, leaving git log readers without insight into what actually
changed. Now buildDeterministicMergeMessage calls summarizeCommitBody
(title-summarizer lane when configured, default model otherwise) with
the step commits + diffstat, and emits a three-section body: AI summary
+ Commits merged + Files changed. The deterministic sections always
ship so AI failure / timeout still yields a substantive message.

Also extends summarizeCommitBody to take an optional commitLog and
loosens its prompt for more detail when the change warrants it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 09:54:54 -07:00
Fusion
3458cfc70e feat(FN-2734): merge fusion/fn-2734
- docs(FN-2734): complete Step 7 — cross-link routing docs

Fusion-Task-Id: FN-2734
2026-04-29 09:54:12 -07:00
Fusion
a41e058be5 feat(FN-2957): merge fusion/fn-2957
- test(FN-2957): complete Step 3 — cover bdo path rendering and CSS truncation

Fusion-Task-Id: FN-2957
2026-04-29 09:46:16 -07:00
Fusion
067d7f3048 feat(FN-2853): merge fusion/fn-2853
- test(FN-2853): complete Step 1 — expand RoutingTab coverage

Fusion-Task-Id: FN-2853
2026-04-29 09:29:26 -07:00
Fusion
f8dae88e12 feat(FN-2958): merge fusion/fn-2958
- test(FN-2958): complete Step 2 — cover merging pinning sort behavior

Fusion-Task-Id: FN-2958
2026-04-29 09:21:30 -07:00
Fusion
b42eac3891 feat(FN-2731): merge fusion/fn-2731
- feat(FN-2731): add changeset for multi-node routing feature
- feat(FN-2730): merge fusion/fn-2730
- feat(FN-2729): merge fusion/fn-2729
- chore(release): v0.8.4
- chore(dashboard): tidy stray workspace artifacts
- refactor(core,merger): consolidate AI commit-body summarization into ai-summarize.ts
- feat(merger,dashboard): use title-summarization model for commit body AI + reword settings
- fix(engine): guarantee non-empty merge commit body via AI fallback cascade
- fix(FN-XXX): sync workspace version on release
- feat(FN-2729): unify node status indicator with NodeHealthDot
- fix(FN-0000): harden sqlite startup validation
- fix(FN-XXX): align tui startup update check
- fix(FN-XXX): harden windows path handling
- fix(engine): tighten Layer 3 — pass safety constraint into AI prompt + harden Layer 2 restore
- feat(FN-2944): merge fusion/fn-2944
- fix(engine): auto-recover from squash-merge orphan rebase failures
- feat(FN-2948): merge fusion/fn-2948
- feat(FN-2939): merge fusion/fn-2939
- feat(FN-2946): merge fusion/fn-2946
- feat(FN-2941): merge fusion/fn-2941
- feat(FN-2938): merge fusion/fn-2938
- feat(FN-2929): merge fusion/fn-2929
- feat(FN-2934): merge fusion/fn-2934
- feat(FN-2930): merge fusion/fn-2930
- feat(FN-2928): merge fusion/fn-2928
- feat(FN-2927): merge fusion/fn-2927
- feat(FN-2916): streamline Cloudflare quick tunnel settings UX
- feat(FN-2913): merge fusion/fn-2913
- feat(FN-2911): merge fusion/fn-2911
- feat(FN-2901): merge fusion/fn-2901
- feat(FN-2729): merge fusion/fn-2729

Fusion-Task-Id: FN-2731
2026-04-29 09:16:23 -07:00
Fusion
4a9345301a feat(FN-2730): merge fusion/fn-2730
- fix(FN-2729): silence ansi strip lint warning
- test(FN-2729): complete Step 10 — cover node health indicators
- feat(FN-2729): complete Step 9 — colorize CLI node status output
- feat(FN-2729): complete Step 8 — use NodeHealthDot in settings routing status
- test(FN-2729): align ListView node override option expectations
- feat(FN-2729): complete Step 7 — add bulk node status indicators

Fusion-Task-Id: FN-2730
2026-04-29 09:11:44 -07:00
Fusion
9bdc80fa06 feat(FN-2729): merge fusion/fn-2729
- feat(FN-2729): align routing lock and bulk node status indicator
- feat(FN-2729): complete Step 4 — remove duplicated node status CSS
- feat(FN-2729): complete Step 3 — add routing summary health dot
- feat(FN-2729): complete Step 2 — adopt NodeHealthDot in InlineCreateCard
- feat(FN-2729): complete Step 1 — adopt NodeHealthDot in TaskForm

Fusion-Task-Id: FN-2729
2026-04-29 09:05:04 -07:00
gsxdsm
3672700306 chore(release): v0.8.4
Version bump via changesets.
2026-04-29 08:59:49 -07:00
gsxdsm
d945947a05 chore(dashboard): tidy stray workspace artifacts
Two pre-existing local modifications that had been sitting in the
working tree across this session, neither produced by the recovery /
fallback work in adjacent commits. Committing them so the tree is clean.

- packages/dashboard/app/components/SettingsModal.css
  Removes one trailing blank line at end-of-file. No semantic change.

- packages/dashboard/app/components/__tests__/ListView.test.tsx
  Drops one test case ("shows NodeHealthDot for selected bulk node
  override", 15 lines) from the "ListView - Bulk Selection" describe
  block. The test asserted that selecting a bulk node override
  rendered a `.status-dot--online` indicator in the DOM. Sibling tests
  (option labels, batchUpdateTaskModels invocation) are preserved.
  Likely debris from the FN-2729 NodeHealthDot work that didn't survive
  one of the in-flight squash merges; the underlying behavior is still
  exercised by the kept tests.

Verified: pnpm --filter @fusion/dashboard test ListView passes
(125/125), so the removed assertion isn't load-bearing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:57:44 -07:00
gsxdsm
414cbcffda refactor(core,merger): consolidate AI commit-body summarization into ai-summarize.ts
Moves the commit-body AI helper out of merger.ts into the existing
core/ai-summarize.ts module so all short-summary AI work (titles,
chat titles, fallback merge commit bodies) shares one home with
consistent dispatch semantics, error handling, and session lifecycle.

Core (ai-summarize.ts):
- New `summarizeCommitBody(diffStat, rootDir, provider, modelId, opts)`
  exported alongside `summarizeTitle`. Same shape (provider/modelId
  args), same get-engine-or-bail dynamic loading via `getFnAgent`,
  same readonly-tools session, same disposal-in-finally pattern.
- Differs from `summarizeTitle` in three deliberate ways suited to the
  commit-body job:
    1. Returns null on any failure instead of throwing — the caller is
       always the merger, which has a deterministic fallback chain
       behind it. Throwing would force the merger to wrap every call
       in try/catch.
    2. Accepts an optional `signal` to forward engine-pause / shutdown
       cancellation, plus a configurable `timeoutMs` (default 30s)
       so a wedged AI session can't stall a merge indefinitely.
    3. Larger output ceiling (2000 chars vs title's 60) and larger
       input ceiling (4000 chars truncated diff) — commit bodies are
       multi-line and need more room than a 60-char title.
- Exported alongside `summarizeTitle` from `@fusion/core`. Constants
  (`COMMIT_BODY_SYSTEM_PROMPT`, `MAX_COMMIT_BODY_INPUT_LENGTH`,
  `MAX_COMMIT_BODY_LENGTH`, `DEFAULT_COMMIT_BODY_TIMEOUT_MS`) re-exported
  for callers that want to override behavior.

Engine (merger.ts):
- Dropped the local `aiGenerateCommitBody` function (~70 lines) — it
  duplicated the session-creation pattern from `summarizeTitle` while
  living in a place where future maintainers wouldn't think to look.
- `resolveSafeCommitBody` now imports `summarizeCommitBody` from
  `@fusion/core` and delegates. The cascade behavior is unchanged
  (commitLog → AI → diff stat → synthetic) and the title-summarizer
  model preference is preserved (provider/modelId resolved here, then
  passed through).

Tests:
- 6 new test cases in `ai-summarize.test.ts` covering:
  empty input → null, missing engine → null (graceful, never throws),
  missing engine + model selection → null, pre-aborted signal → null,
  custom timeout (returns quickly under 1s ceiling), exposed constants.
- Core: 3136/3136 pass (was 3130 — +6 new). Engine: 2887/2887 pass.
- Typecheck clean, workspace lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:30:34 -07:00
gsxdsm
5c2240caab feat(merger,dashboard): use title-summarization model for commit body AI + reword settings
Wires the AI commit-body generator (introduced in 52928ff5e) to the
existing dedicated title-summarization model lane, and updates the
settings UI so users understand the model is now used for two
short-summary jobs instead of just one. Also de-duplicates the
project-scope settings UI which was exposing the same model setting in
two places.

Engine (merger.ts):
- aiGenerateCommitBody now prefers settings.titleSummarizerProvider /
  titleSummarizerModelId over the merger's default model. The
  summarization lane is the right tier for this work — small, fast,
  cheap. Falls back to the default merger model when the summarization
  lane is unset.

Dashboard (SettingsModal.tsx):
- MODEL_LANES summarization lane label updated:
  "Title Summarization Model" → "Title and Git Commit Message
  Summarization Model". Helper text updated to mention the dual purpose
  (auto-generated task titles + fallback merge commit message bodies).
  This change flows through automatically to BOTH the global model
  lanes view and any project-scope rendering of MODEL_LANES.
- Removed the duplicate summarization picker from the project-scope
  Model Lanes section: previously it appeared once under Model Lanes
  AND once under "AI Summarization". Now lives only in the dedicated
  picker so users have a single source of truth in project scope.
- The dedicated picker section heading + description rewritten:
  "AI Summarization" → "AI Title and Git Commit Message Summarization",
  with a paragraph explaining both jobs the model performs.
- Inner dropdown label updated for consistency.

Tests + checks: engine 2887/2887 pass, dashboard typecheck clean,
workspace lint clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:22:04 -07:00
gsxdsm
52928ff5e7 fix(engine): guarantee non-empty merge commit body via AI fallback cascade
Audit of merge commit sites surfaced four paths that could produce an
empty commit body when the branch had no unique commits relative to its
base (so `git log <base>..<branch>` returns empty), or when the `git log`
collection itself failed. Subject was always non-empty so git accepted
the commit, but the body was missing — breaking downstream consumers
(release notes, dashboard summaries, mergeDetails) that read it.

The AI merge agent is the primary author of merge commit messages; these
fallback paths only run when the agent didn't commit and the merger has
to commit on its behalf. Previously they used `-m "${commitLog}"` which
silently produced `-m ""` on empty input.

Now uses a 4-tier resolveSafeCommitBody cascade — most informative
first, with a deterministic floor so the function never returns empty
and never throws:

  1. The branch's commit log if non-empty.
  2. AI-generated body via aiGenerateCommitBody — a fresh readonly
     session that summarizes the diff stat into 2–6 bullet points.
     Bounded by a 30s timeout (forwards the caller's abort signal too)
     so engine pause / shutdown tears it down promptly. Any failure
     falls through.
  3. The diff stat itself, formatted as a "Files changed" listing.
  4. A synthetic `- merge <branch>` placeholder.

Wired into all three merger fallback commit sites:
  - Auto-resolved-conflicts commit (Attempt 2 success path)
  - -X ours / -X theirs side-strategy commit (Attempt 3)
  - Agent-didn't-commit fallback commit (post-AI verification)

Also defensive: removed `--allow-empty-message` from the executor's
squash-import commit. The message is hardcoded non-empty (subject +
body), but the flag was a footgun — git would silently accept an empty
message if the construction ever broke. Switched to two `-m` args
(subject and body separately) so empty would now correctly fail at
git's level rather than silently land a blank-message commit.

Tests + checks: engine 2887/2887 pass, typecheck clean, workspace lint
clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 08:19:18 -07:00
gsxdsm
daf6dfa2c2 fix(FN-XXX): sync workspace version on release 2026-04-29 08:15:38 -07:00
Fusion
d250f866d6 feat(FN-2729): unify node status indicator with NodeHealthDot
- Resolve merge conflicts in InlineCreateCard and QuickEntryBox using the existing node picker UX
- Replace ad-hoc node status rendering with NodeHealthDot in task creation surfaces
- Keep advanced quick-create controls and portal-based dropdown behavior intact
- Preserve related dashboard styling and tests included in the staged squash

Fusion-Task-Id: FN-2729
2026-04-29 08:15:01 -07:00
gsxdsm
5661188a61 fix(FN-0000): harden sqlite startup validation 2026-04-29 07:58:58 -07:00
gsxdsm
597295e749 fix(FN-XXX): align tui startup update check 2026-04-29 07:54:45 -07:00
gsxdsm
42c27fcc3e fix(FN-XXX): harden windows path handling 2026-04-29 07:35:23 -07:00