Commit Graph

768 Commits

Author SHA1 Message Date
Fusion
6bc2de9aa4 feat(FN-3205): add changeset documenting TUI memory ordering changes
Merges the changeset documenting the TUI memory ordering feature (FN-3205), completing the final delivery step for this work.

Fusion-Task-Id: FN-3205
2026-05-02 21:48:46 -07:00
Fusion
17f5d4a058 feat(FN-3156): add database schema init hook runner for plugin settings lif
The merge adds plugin schema initialization lifecycle support (FN-3156), introduces a ResearchTaskActionModal with model fallback notifications (FN-3012, FN-3008), adds async planning draft sync to prevent UI blocking (FN-3229), and implements viewport-conditional mission split layout (FN-3130). Inf

Fusion-Task-Id: FN-3156
2026-05-02 20:30:18 -07:00
Fusion
e1c10721a3 feat(FN-3008): notify when model settings fall back to defaults
Merges FN-3008 to add a "fallback-used" notification system: the engine now emits events when AI model fallbacks are triggered, dispatches notifications via ntfy/webhook providers, surfaces a session banner in the dashboard, and exposes a settings toggle to enable or disable these alerts.

Fusion-Task-Id: FN-3008
2026-05-02 19:55:54 -07:00
gsxdsm
c769444f1c fix(dashboard): accept git diff --no-index exit code 1 with stdout
`git diff --no-index` exits 1 when files differ — that's the success case for synthetic untracked-file diffs, not an error. Use spawn directly so we can resolve on exit 0 or 1, independent of how callers (or test mocks) wrap execFile / promisify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 17:25:30 -07:00
gsxdsm
922782ffc6 chore(deps): bump pi-ai and pi-coding-agent from 0.70.0 to 0.72.1
Refreshes the built-in model catalog feeding ModelRegistry with the
latest entries upstream pi-ai generates from models.dev (Anthropic,
OpenAI, Codex, Bedrock, etc.). No Fusion-side API changes; upgrades
applied in cli, dashboard, and engine package.json plus lockfile.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 15:49:07 -07:00
gsxdsm
3bafc48000 perf(dashboard): replace blocking pgrep execSync with async execFile
Two sync hot paths were stalling the dashboard event loop on a periodic
timer:

1. `pgrep -f vitest` ran via `execSync` in `getVitestProcessIds`
   (`/api/system-stats`, `/api/kill-vitest`) and `killVitestProcesses`
   (TUI memory-pressure check). On a busy machine pgrep walking the
   process table can take 100ms+; execSync blocks the entire Node event
   loop for that duration, so every concurrent dashboard request hangs
   while pgrep runs. The TUI variant fired on every memory-pressure tick
   (~2s when over threshold), the dashboard variant fired on every
   system-stats poll (5s while the modal is open). Both now use execFile
   with a callback wrapped in a Promise.

2. `discoverDashboardPiExtensions` (called from 3 /api/settings/pi-
   extensions routes) did 6+ blocking existsSync/readFileSync calls per
   invocation across legacy and fusion settings paths. Converted to
   fs.promises.readFile/access and parallelized via Promise.all.

Behavior preserved:
- TUI memory-pressure detection still works (sync os.totalmem path
  unchanged); auto-kill still fires on threshold breach.
- The `lastAutoKillAt` 30s re-fire gate is set before the async kill
  starts, so concurrent ticks can't trigger duplicate kills.
- system-stats still polls every 5s while the modal is open and still
  returns vitestProcessCount.
- All 7 system-stats / kill-vitest tests pass; all 6 settings/pi-
  extensions tests pass. Test mocks updated for the (err, stdout, stderr)
  callback signature.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 14:57:54 -07:00
gsxdsm
df04acd4e2 fix(engine): give merge commits a real subject in fallback paths
Three merger fallback commit paths (auto-resolve-all-conflicts,
-X theirs/ours side strategy, AI-agent-didn't-commit) hard-coded
`feat(FN-XXXX): merge fusion/fn-xxxx` as the subject and never used
the AI subject summarizer. Route them through buildDeterministicMergeMessage
so they pick up aiSubject when available.

When the AI subject summarizer returns null, derive the subject from
the branch's first step commit (with conventional-commit prefix
stripped, plus `(+N more)` for multi-commit branches) instead of the
bare `merge <branch>` template.

Bump DEFAULT_COMMIT_SUBJECT_TIMEOUT_MS 15s → 30s so slow-first-token
providers complete instead of silently falling back.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:32:47 -07:00
Fusion
174453465f feat(FN-3106): add draft planning workflow with createAiSession plugin API
This merge delivers the full draft planning feature (FN-3106) — API routes for planning subtasks, the AiSessionStore backend for draft sessions, a draft planning API client, auto-creation of planning drafts from user input, and corresponding UI polish in PlanningModeModal with accessibility-focused

Fusion-Task-Id: FN-3106
2026-05-02 13:32:09 -07:00
Fusion
5ebccc43cc feat(FN-3155): add createAiSession plugin context API with DI wiring
This merge brings FN-3155's plugin `createAiSession` API (types, DI hooks, engine adapter, context wiring, docs, and tests), FN-3056's task title sanitization, and FN-3129's tokenized footer and mobile initialization for MissionManager. It also adds CentralCore Docker node management, a new AddNodeM

Fusion-Task-Id: FN-3155
2026-05-02 13:24:37 -07:00
gsxdsm
2769e4a57b fix(core): allow empty command in updateSchedule when steps present
Aligns updateSchedule validation with createSchedule so step-based
automations (auto-summarize, memory dreams) can sync at startup
without hitting "Command cannot be empty".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 13:11:43 -07:00
Fusion
6b4f28a1fb feat(FN-3056): merge fusion/fn-3056
This merge ships several feature and infrastructure improvements across the codebase. Task title validation is strengthened in triage with stricter rejection of malformed titles and preference for prompt-declared titles (FN-3056), while task creation now preserves priority settings (FN-3210). The Mi

Fusion-Task-Id: FN-3056
2026-05-02 11:41:40 -07:00
gsxdsm
9c45d2410b perf(test): cap vitest worker fan-out to keep dashboard responsive
On high-core dev machines (e.g. 28-core M-series), per-package vitest
defaulted to cpus().length - 1 workers (27), and `pnpm test` ran 4
workspace packages concurrently — easily 100+ vitest threads per sweep.
When the dashboard had agents running tests, 2+ concurrent sweeps would
saturate CPU and the UI became sluggish.

- Cap defaultMaxWorkers to min(6, cpus()-1) in cli/dashboard/desktop/
  mobile/plugin-sdk vitest configs (engine and core were already capped)
- Lower root `pnpm test` workspace-concurrency 4 → 2
- VITEST_MAX_WORKERS override still respected for explicit fast runs

Worst-case fan-out drops from ~108 workers to ~12 per `pnpm test`.
CI runners with fewer cores are unaffected (cap doesn't bind).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:30:02 -07:00
gsxdsm
bf7caf5a57 fix: stack planning modal summary actions on mobile
The nested action row kept "Create Single Task" and "Break into Tasks"
side-by-side on small screens, pushing the primary button offscreen.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 11:03:36 -07:00
Fusion
44cc899eb9 feat(FN-3185): preserve progress on task reset with explicit confirmation d
This merge implements a "preserve progress" option for task resets across the system. FN-3185 adds a `preserveProgress` flag to `moveTask` that keeps status/history when resetting tasks back to `todo`, with required explicit confirmation dialogs to prevent accidental resets. The feature is wired thr

Fusion-Task-Id: FN-3185
2026-05-02 10:20:44 -07:00
gsxdsm
222e11c2f8 fix(FN-3175): reduce dashboard log stalls 2026-05-02 08:05:33 -07:00
Fusion
6ae7aefaf4 feat(FN-3076): add automatic completion documentation mode for tasks
Merged FN-3076 introducing an auto completion-doc mode that automates task completion documentation. The feature adds a new setting to the settings schema and types, surfaces it in the dashboard Settings UI, provides triage-stage guidance to suggest completion documentation, and is documented in the

Fusion-Task-Id: FN-3076
2026-05-02 07:36:28 -07:00
Fusion
8f72eeed9e feat(FN-3121): merge fusion/fn-3121
This merge lands v0.15.0, bringing a major plugin system overhaul including a new dependency graph plugin with SQLite-backed storage, Quick Chat FAB with slash-triggered skill menu, and expanded plugin dashboard views. The AgentsView tree mode was fully removed with its hook, styles, and expansion s

Fusion-Task-Id: FN-3121
2026-05-02 00:30:21 -07:00
gsxdsm
43b75c4d7d chore(release): v0.15.0
Version bump via changesets.
2026-05-01 23:38:03 -07:00
gsxdsm
9fc5fd99c4 fix(FN-XXXX): avoid inheriting unregistered parent projects 2026-05-01 23:35:44 -07:00
Fusion
9e52028102 feat(FN-3079): add plugin dashboard views and dependency graph plugin
- Add plugin dashboard view registration and hosting across core, dashboard routes, and plugin SDK exports
- Integrate plugin-provided views into app navigation, mobile/header UI, and view state hooks with coverage
- Add fusion-plugin-dependency-graph example plugin with persisted storage, dashboard view UI, and manifest wiring
- Update plugin authoring and architecture docs for dashboard view extension points
- Add a changeset for @runfusion/fusion covering plugin dashboard view support

Fusion-Task-Id: FN-3079
2026-05-01 23:32:35 -07:00
Fusion
ed477f8c71 feat(FN-3173): add SQLite WAL tuning, integrity checks, and agent log batch
This merge brings FN-3173's SQLite stability improvements: WAL tuning pragmas for better concurrency, periodic integrity checks with self-healing recovery, and batched agent log writes to reduce I/O overhead. It also includes a new cron-runner for scheduled maintenance tasks, TUI mouse wheel scrolli

Fusion-Task-Id: FN-3173
2026-05-01 23:26:14 -07:00
gsxdsm
29892cace0 chore(release): v0.14.3
Version bump via changesets.
2026-05-01 23:19:47 -07:00
gsxdsm
66a19b52fc feat(FN-XXXX): scroll TUI panes with mouse wheel
Enable xterm SGR mouse reporting in the dashboard TUI and dispatch
wheel events to the focused pane: task detail logs, Git lists
(commits/branches/worktrees), and Files view (tree or preview).
Mouse mode is enabled after Ink mounts so the leading ESC of wheel
reports never arrives alone — avoiding spurious Esc keypresses. We
omit motion-tracking modes so terminals still own drag gestures and
Shift+drag native text selection keeps working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 23:18:19 -07:00
gsxdsm
dd291db725 fix(FN-XXXX): tokenize backup-command matcher
Two follow-ups to the in-process backup interception:

- Previously the matcher only allowed a bare `npx` prefix, so the
  canonical zero-install form `npx -y runfusion.ai backup --create`
  (and any `npx --yes` / `-p <pkg>` / `--package=<pkg>` variant) fell
  through to the legacy shell-out path. The matcher now consumes any
  number of npx flags before the binary token so all canonical
  invocations route through the in-process executor.
- Previously the matcher accepted arbitrary text after `--create` and
  the runner silently dropped it. Authors writing
  `fn backup --create && notify-send done` or
  `fn backup --create | tee log` reasonably expected the trailing
  side effect to fire. The matcher now refuses any command containing
  shell continuations / redirections / substitutions
  (`&&`, `||`, `|`, `;`, `>`, `<`, backticks, `$()`), and rejects
  trailing positional arguments. Such commands shell out as the user
  wrote them.

The matcher is now a small tokenizer rather than a regex collection,
so the contract is easier to read and the unit-test grid covers each
permitted prefix combination plus all the previously-unhandled shell
forms.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:58:18 -07:00
gsxdsm
31195374d4 fix(FN-XXXX): quiet pi-claude-cli MCP config refresh log
Demote the refresh message from console.error to debugMcp so it no
longer appears as an error in normal output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:58:00 -07:00
gsxdsm
24b3ded03f feat(FN-XXXX): add fnBinaryCheckEnabled global setting
Defaults to true so existing behaviour (dashboard probes PATH for `fn` /
`fusion` and surfaces install / version-mismatch states) is unchanged.
When the user toggles it off in Settings → General → CLI Binary:

- `GET /system/fn-binary/status` short-circuits before `detectFnBinary()`
  and returns `state: "skipped"`. No `<bin> --version` subprocess is
  spawned at all, so an outdated globally-installed CLI cannot run as a
  side effect of opening the dashboard.
- The install banner is hidden when `state` is `"skipped"`.
- `POST /system/fn-binary/install` rejects with HTTP 409 since install
  is the user action that the status check informs.
- The Settings UI gains a checkbox under the existing CLI binary panel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:53:22 -07:00
gsxdsm
5a41ce42e9 fix(FN-XXXX): narrow backup matcher and isolate version probes
Two follow-up corrections to the in-process auto-backup interception:

- The matcher previously hijacked any `fn backup …` / `fusion backup …` /
  `runfusion.ai backup …` form. The in-process replacement only knows how
  to do `--create` + cleanup, so scheduling `--list`, `--cleanup`, or
  `--restore <file>` would have silently executed a create instead of the
  requested operation. The matcher is now anchored to `backup --create`
  (with optional trailing flags), with positive/negative unit tests.
- Step-based automations (`AutomationStep` with `type: "command"`) also
  shell out — the legacy-command interception alone left that path
  vulnerable. `executeCommandStep` now applies the same in-process backup
  detour, factored through a shared `runBackupActionInProcess` helper.

Independently, `runProbe` in fn-binary now spawns with `cwd: tmpdir()`.
The dashboard's `/system/fn-binary/status` route runs `<bin> --version`
on whatever fusion binary happens to be on PATH — older releases (e.g.
v0.13.0) initialise an engine and create a fresh `.fusion/<project>/
.fusion/` tree as a side effect. Pinning the probe's cwd to the OS temp
directory keeps any such artefacts off the developer's project.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:49:03 -07:00
gsxdsm
85924722d4 fix(FN-XXXX): run auto-backup in-process to stop nested .fusion creation
The backup automation was scheduled with `npx runfusion.ai backup --create`, which spawns whatever fusion binary is on PATH. On developer machines that's usually an older globally-installed runfusion.ai (v0.13.0 at time of writing) which still carries the pluginStore-rootDir bug — every backup tick recreated `<project>/.fusion/.fusion/` with a fresh empty TaskStore.

Cron-runner and routine-runner now intercept any command matching `fn backup`, `fusion backup`, or `npx runfusion.ai backup` and call `runBackupCommand` directly via the engine's open TaskStore. The interception also handles existing schedules persisted with the old npx command, so users do not need to manually update their automation rows.

The default command for newly created backup schedules is also simplified to `fn backup --create` — both forms route through the same in-process executor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:38:37 -07:00
gsxdsm
36d623a16f fix(FN-XXXX): guard Database against nested .fusion/.fusion paths
Throws if a caller passes a path whose last two segments are both `.fusion` — that pattern only happens when a Store class joins `.fusion` onto a path that already ends in `.fusion`. Surfaces the bug at the call site instead of silently creating a stray nested directory under the project. Complements the recent in-process-runtime PluginStore fix by catching any other call paths still passing the wrong rootDir.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 21:56:59 -07:00
gsxdsm
03d0fac59c fix(FN-3187): stabilize agent run log streaming 2026-05-01 18:37:28 -07:00
gsxdsm
7fec762971 fix(FN-XXXX): stop engine creating nested .fusion/.fusion dir
PluginStore expects a project-root path and appends `.fusion` itself, but the in-process runtime was handing it the already-resolved `.fusion` directory — producing a spurious `.fusion/.fusion/fusion.db` on every engine startup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 18:22:49 -07:00
gsxdsm
344aaa73c1 chore(release): v0.14.2
Version bump via changesets.
2026-05-01 17:46:40 -07:00
Fusion
b3e2b614c8 feat(FN-3059): align provider metadata and documentation
Merged feat(FN-3059) which aligns provider metadata and documentation across the codebase, updating README and getting-started docs plus refinements to the CustomProviderForm and ProviderIcon dashboard components.

Fusion-Task-Id: FN-3059
2026-05-01 17:39:47 -07:00
gsxdsm
7ec394ae7f fix(FN-XXXX): show chat streaming feedback during Claude waits 2026-05-01 17:30:59 -07:00
gsxdsm
675a72869f chore(release): v0.14.1
Version bump via changesets.
2026-05-01 16:55:42 -07:00
Fusion
cafe986f1b feat(FN-3140): add readonly custom tools and plugin SDK
This merge adds readonly custom tool preservation (FN-3140) with new plugin SDK types and documentation, fixes PluginManager responsive overflow (FN-3093), and integrates the fn-3065 branch with enhanced plugin authoring capabilities. The core plugin-types module was significantly expanded with 230+

Fusion-Task-Id: FN-3140
2026-05-01 16:54:42 -07:00
gsxdsm
f31acbb7b8 chore(release): v0.14.0
Version bump via changesets.
2026-05-01 16:04:55 -07:00
gsxdsm
e505bad87b Add changeset 2026-05-01 16:04:06 -07:00
gsxdsm
4231c4a151 feat(fusion): add Global → General settings pane and wire fn --version
Move the Star-on-GitHub toggle, CLI Binary panel, and update-check
controls out of project General into a new Global → General pane (with
an inline Updates subsection), matching their actual scope. Drop the
CLI Binary panel's outlined card background and apply the standard
horizontal indent so it doesn't bleed to the pane edges.

Wire --version / -v in the fn/fusion bin so the dashboard's CLI Binary
probe gets a real version string instead of booting the dashboard and
reporting "unknown".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:02:23 -07:00
gsxdsm
e72eff47e9 fix(fusion): persist priority changes from PATCH /tasks/:id
The dashboard task-edit route destructured every editable body field
except priority, so changing priority via the task-detail modal was
silently dropped before reaching store.updateTask. Wire priority
through with isTaskPriority validation (null resets to default).

Without this fix the priority-aware triage/scheduler/merge ordering
shipped previously had no effect for tasks edited in the dashboard.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 15:57:38 -07:00
gsxdsm
c08a872169 feat(fusion): make auto-merge queue priority-aware
Triage and the todo→in-progress scheduler already sorted by priority
(urgent→low, then createdAt ASC, then id ASC); the auto-merge queue
was strictly FIFO, so a backlogged low-priority task could merge
ahead of an urgent one. drainMergeQueue now picks the highest-
priority eligible task each iteration, and the four in-review sweeps
(startup, periodic, global unpause, engine unpause) sort by priority
before enqueueing so the single-item fast path also picks priority-
first. Picker is hardened against concurrent queue mutation by stop()
and pause-handler removal: it re-locates the chosen entry by id and
re-checks shuttingDown after awaiting getTask.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 15:45:00 -07:00
Fusion
1634ea39ad feat(FN-3046): add fn binary panel and standalone CLI entrypoint
This merge introduces a standalone CLI binary mode ("droid") with a new dashboard panel for binary management, adds a todo planning entrypoint with peer exchange shutdown, and includes documentation updates for the CLI reference and standalone deployment. Key additions span the core database layer,

Fusion-Task-Id: FN-3046
2026-05-01 13:56:55 -07:00
Fusion
0188da703b feat(FN-3078): merge fusion/fn-3078
This merge lands four features: a `/clear` command for Chat and Quick Chat with session banner fixes (FN-3062), a todo view redesign with restructured rows and improved styling (FN-3063), deterministic peer exchange shutdown with dashboard improvements (FN-3040), and a summary Q&A disclosure feature

Fusion-Task-Id: FN-3078
2026-05-01 13:40:21 -07:00
Fusion
8b7f20f207 feat(FN-3040): make peer exchange shutdown deterministic and improve dashbo
This merge lands seven features and fixes across the dashboard and engine. Notable changes: restructured TodoView rows with improved action row styling, added `/clear` command to Chat and QuickChat, persisted session banner dismissals with a hide-banner setting, made peer exchange shutdown determini

Fusion-Task-Id: FN-3040
2026-05-01 13:34:40 -07:00
gsxdsm
4d70a9efc7 docs: changeset for planning screen session reload
Document the unconditional reload of the selected planning session into
the right pane on show, which shipped alongside 5398bc7 without an
explicit changeset entry.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 13:10:18 -07:00
gsxdsm
5398bc7fc1 fix: persist session banner dismissals and add hide-banner setting
- Stop overwriting AI session titles with the "Planning session" fallback
  during cross-tab broadcasts before initialPlan has hydrated on resume.
- Persist SessionNotificationBanner dismissals to localStorage keyed by
  updatedAt so they survive refresh and auto-re-show on the next event.
- Add Settings → Appearance toggle to hide the banner entirely.
- Drop the inner scrollbar on the planning question list; let the outer
  pane handle all scrolling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 13:08:07 -07:00
Fusion
80b45d0bd5 feat(FN-3033): align agent asset directory naming and heartbeat path compat
The merge delivers three major features: a droid CLI path reconciliation extension that resolves workspace path mismatches for spawned agents, session-first quick chat with improved heartbeat prompts and a dramatically simplified QuickChatFAB component, and canonical agent asset directory naming wit

Fusion-Task-Id: FN-3033
2026-05-01 12:54:17 -07:00
Fusion
72ed14326b feat(FN-2985): add droid CLI path reconciliation extension
Adds a new pi extension that reconciles droid CLI paths, with corresponding staging support in the tsup build config for bundling the droid-cli. The extension is wired into the engine and exported from core, with tests covering the path reconciliation logic.

Fusion-Task-Id: FN-2985
2026-05-01 12:30:20 -07:00
Fusion
fd36fbdf9d feat(FN-3036): fix heartbeat prompt composition for autonomous agents
This merge fixes heartbeat prompt composition for autonomous agents (FN-3036) so child agents spawned via `spawn_agent` receive properly formatted system prompts with heartbeat instructions, adds regression tests and documentation for the behavior, and removes duplicate constructor assignments in He

Fusion-Task-Id: FN-3036
2026-05-01 12:06:48 -07:00
gsxdsm
f0d0f8ce29 fix(dashboard): planning mode question display + new-session reset
- Add 8s polling fallback while view is "loading" so a missed SSE
  question/summary event self-heals instead of leaving the panel stuck
  on "thinking" until close+reopen.
- Track dismissed resumeSessionIds in a ref and drop loadSession from
  the resume effect's deps so typing into the textarea no longer
  re-fires resume and yanks the user back to the previous session.
- Guard SSE onThinking/onQuestion/onSummary against late events from a
  torn-down connection by comparing the captured sessionId against
  currentSessionIdRef.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 11:40:48 -07:00