Commit Graph

3167 Commits

Author SHA1 Message Date
Fusion
0f1da6e6af feat(FN-2447): add dependency-aware task delete flow
- Extend TaskStore deleteTask with a safe default that blocks deleting tasks still referenced by live dependents
- Add an opt-in removeDependencyReferences path that rewrites dependent tasks atomically before deletion
- Update dashboard API/routes to surface TASK_HAS_DEPENDENTS as a 409 with structured details and a delete query flag
- Add TaskCard/TaskDetailModal confirmation-retry UX plus coverage in core, dashboard route/API, and component tests
- Document the new delete semantics and opt-in behavior in the dashboard API README
2026-04-24 08:55:02 -07:00
Fusion
82158cc570 feat(FN-2448): add Hermes runtime plugin to pnpm workspace
- Add plugins/fusion-plugin-hermes-runtime to pnpm-workspace package globs
- Register the Hermes runtime importer in pnpm-lock.yaml
- Capture workspace link to @fusion/plugin-sdk and dev toolchain dependencies for the new plugin
2026-04-24 08:55:02 -07:00
Fusion
1b4326739e feat(FN-2406): persist dashboard auth token and harden TUI layout
- Persist dashboard auth token in global settings and add daemon-token utilities for reuse
- Update dashboard CLI command auth precedence and token handling behavior
- Harden dashboard TUI log viewport budgeting to avoid footer overlap under constrained heights
- Expand CLI and TUI test coverage for token persistence, auth precedence, and environment mocking
- Refresh README/CLI/getting-started docs and add changesets for token persistence and TUI fix
2026-04-24 08:55:02 -07:00
Fusion
b3cf118799 fix(FN-2400): harden dashboard TUI log viewport budgeting
- Rework logs viewport calculation to budget by rendered rows and keep content above footer hints
- Add zero-row safety handling for short terminals with a dedicated expansion hint instead of overlapping output
- Cap wrapped log rendering by remaining row budget so long messages cannot overflow into footer space
- Add regression tests for footer-safe list windowing and wrapped-line truncation, plus a patch changeset for @runfusion/fusion
2026-04-24 08:55:02 -07:00
Fusion
606de5d14c feat(FN-2394): add Fusion reinstall flow for Pi extensions
- Add dashboard route and server handling to reinstall the Fusion Pi extension
- Introduce a client API helper and wire a reinstall action into PiExtensionsManager
- Polish action spacing and document Fusion reinstall recovery in the CLI README
- Expand route, API, and component tests including reinstall refresh stability coverage
- Add a changeset for @runfusion/fusion patch release
2026-04-24 08:55:02 -07:00
Fusion
aa25b8c4a2 fix(FN-2419): preserve three-state bulk model selection
- Add optional noChangeValue/noChangeLabel support to CustomModelDropdown so No change can coexist with Use default
- Update ListView bulk model controls to pass through a dedicated __no_change__ sentinel and avoid conflating untouched with clear-to-default
- Keep batch update payloads explicit by sending null provider/model only for Use default while leaving untouched lanes undefined
- Add dashboard tests covering No change vs explicit model vs Use default behavior and update README bulk-edit documentation
2026-04-24 08:55:02 -07:00
Fusion
e6ee31108b feat(FN-2320): add settings-tab agent deletion controls
- Add a Danger Zone section in AgentDetailView settings with a Delete Agent action
- Reuse the existing delete confirmation/handler flow and gate deletion to idle or terminated agent states
- Add UI styling for danger sections and deletion guidance text in settings
- Expand AgentDetailView tests to cover enabled/disabled states plus confirm/cancel deletion paths
- Document settings-tab deletion behavior and constraints in docs/agents.md
2026-04-24 08:55:02 -07:00
Fusion
b8d821de5a feat(FN-2393): auto-install bundled Fusion skill during init
- Add reusable skill-installation helper that targets Claude, Codex, and Gemini skill homes
- Wire bundled skill installation into fn init with per-client installed/skipped/warning logging
- Add init command tests for install success, preserving existing installs, and non-fatal warning behavior
- Document the new init behavior in CLI/getting-started docs and add a patch changeset for @runfusion/fusion
2026-04-24 08:55:02 -07:00
Fusion
1076a3360c feat(FN-2441): singularize one-step progress labels
- Update TaskCard step toggle label to render "step" when the unified total is 1
- Update TaskDetailModal completion label to use singular/plural based on total step count
- Add regression tests in TaskCard and TaskDetailModal suites to verify singular labels and reject incorrect plural forms
- Tighten existing completion-count assertions to cover singular/plural text expectations
2026-04-24 08:55:02 -07:00
Fusion
9d77185079 fix(FN-2384): schedule triage and todo tasks by priority-aware FIFO
- Sort eligible todo tasks in Scheduler by priority first, then createdAt/id for stable FIFO ordering within each tier
- Sort eligible triage tasks using the same priority-aware ordering while preserving existing pause/status/recovery gating
- Add regression tests for scheduler and triage ordering, including blocked/paused/recovery-gated edge cases
- Update architecture docs to describe priority-first task dispatch behavior
2026-04-24 08:55:02 -07:00
Fusion
86b427c126 feat(FN-2315): add hidden markdown toggle for project documents
- Extend dashboard file service and routes to support includeHidden when scanning markdown files
- Update API client, markdown hook, and Documents view UI to expose a hidden files toggle
- Add coverage for hidden-file filtering in file-service, hook, and DocumentsView tests
- Stabilize related SettingsModal and TaskForm tests and document toggle behavior in the dashboard README
2026-04-24 08:55:02 -07:00
Fusion
52168d7f2c feat(FN-2383): persist task priority across core storage
- Add task-priority contract, normalization helpers, and exports in @fusion/core types/index
- Store task priority in SQLite and migrate existing databases with default values
- Update task store behavior and sorting tests to preserve and order by persisted priority
- Add migration/regression coverage for archived tasks and refresh storage/task-management docs
2026-04-24 08:54:25 -07:00
Fusion
a07cb53e1d fix(FN-2392): finalize squash merge conflict resolution
- Resolve merge markers across plugin loader, agents view, dashboard server tests, and engine pi session setup
- Keep current cache-busting and hook-guard implementations while removing stale branch-side fragments
- Preserve rate-limit test imports and useAgents-driven loading flow in dashboard agent UI
- Ensure workspace passes required verification gates with pnpm test and pnpm build
2026-04-24 08:54:25 -07:00
Fusion
7529d7a7ed fix(FN-2404): scope onboarding first-task creation to active project
- Guard onboarding first-task creation when no project is selected
- Pass projectId to createTask so onboarding tasks are created in the active project
- Update AppModals wiring tests to verify projectId forwarding for selected and unselected states
- Expand onboarding modal and flow regression tests to assert project-scoped task creation calls
2026-04-24 08:54:25 -07:00
gsxdsm
159e40b42d feat(FN-2310): merge fusion/fn-2310 2026-04-24 08:54:25 -07:00
Fusion
8a0885ad48 fix(FN-2392): normalize skill-facing tool references to fn_*
- Update Fusion skill docs, prompts, and capability references to use public fn_* tool names consistently
- Align engine system prompts and tool schemas for messaging/task actions with fn_send_message, fn_read_messages, fn_task_* naming
- Refresh related tests across CLI, engine, dashboard, and core to match normalized tool naming and behavior
- Add a patch changeset for @runfusion/fusion describing the skill-tool namespace normalization
2026-04-24 08:54:25 -07:00
Fusion
28a2a0c371 feat(FN-2387): unify agents view loading through useAgents
- Move AgentsView to consume agents, loading state, and reload logic directly from useAgents
- Extend useAgents with filterState/showSystemAgents options and always pass includeEphemeral in fetch filters
- Remove duplicate initial fetch/SSE path in AgentsView and rely on hook-managed refresh behavior
- Add regression coverage for single initial load and system-agent visibility toggling behavior
- Update useAgents hook tests to assert the new includeEphemeral fetch contract
2026-04-24 08:54:25 -07:00
Fusion
064e1ddaf7 feat(FN-2386): replace reports-to ID input with manager selector
- Load available agents when the New Agent dialog opens and present them in a Reports To dropdown
- Keep manager assignment optional with a default "No manager" option and graceful fallback when manager fetch fails
- Show manager name plus ID in the step-3 summary while still submitting reportsTo as the selected manager ID
- Add focused NewAgentDialog tests for manager option loading, payload behavior, summary rendering, and failure handling
2026-04-24 08:54:25 -07:00
Fusion
0a4438e51c fix(FN-2370): harden addComment diagnostics and regression coverage
- Improve TaskStore addComment best-effort error diagnostics without interrupting comment writes
- Expand core store regression tests to cover addComment warning and diagnostic paths
- Align dashboard QA-check route test expectations with the updated diagnostics behavior
2026-04-24 08:54:25 -07:00
Fusion
89144681f3 feat(FN-2354): add structured redacted auth-sync diagnostics
- Add a shared auth-sync audit log helper that emits structured settings-sync/auth events with operation, direction, route, node IDs, and provider metadata
- Replace string-based auth sync logs in push, pull, and auth-receive routes with the new structured diagnostic event emission
- Ensure only provider names and counts are logged while filtering out credentials and other sensitive auth material
- Expand node sync route tests to capture runtime log sink events and assert structured fields plus redaction guarantees for push, pull, and receive flows
2026-04-24 08:54:25 -07:00
Fusion
de5dd6f7db feat(FN-2370): merge fusion/fn-2370 (auto-resolved)
- test(FN-2370): complete Step 3 — align qa-check template expectation
- test(FN-2370): complete Step 2 — add regression coverage for addComment diagnostics
- test(FN-2370): complete Step 2 — cover addComment warning regressions
- feat(FN-2370): complete Step 1 — log addComment best-effort failures
- feat(FN-2369): merge fusion/fn-2369
- feat(prompts): require lint alongside tests and typecheck in agent instructions
- perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency
- fix(core): recognize legacy kb-* backups and canonicalize .kb/backups settings
- refactor: eliminate remaining 15 any warnings and ratchet rule to error
- refactor: eliminate ~400 no-explicit-any warnings across the workspace
- feat(core): add getErrorMessage helper for narrowing unknown errors
- refactor: fix and tighten mechanical lint rules
- chore(eslint): fix pre-existing errors surfaced by wider .cjs match
- chore(eslint): promote @typescript-eslint/no-unused-vars from warn to error
- refactor(dashboard,desktop,engine): remove unused imports, props, and locals
- refactor(core): remove unused imports, helpers, and dead migration constant
- refactor(cli): remove unused imports and variables
- refactor: adapt resource loader and tool wiring to pi-coding-agent 0.70
- fix: adapt to AgentState.error → errorMessage rename
- refactor: migrate @sinclair/typebox imports to typebox 1.x
- refactor: migrate to ModelRegistry.create factory
- chore: bump pi-coding-agent + pi-ai to 0.70.0
- refactor: remove legacy kb compatibility
- feat: add "Anthropic — via Claude CLI" as a first-class provider
- test(FN-2358): harden clean-worktree CI verification tests
- fix(FN-2352): add structured terminal websocket diagnostics
- fix: use live merge-base for task diff scope
- feat: backfill Claude skills when useClaudeCli toggle flips on
- fix: prevent nested .fusion/.fusion dir from PluginStore path bug
2026-04-24 08:54:25 -07:00
Fusion
94b1180883 fix(FN-2364): harden diagnostics context and plugin reload imports
- Add explicit operation metadata to agent-generation and ai-session-store diagnostics for cleanup, recovery, and scheduled cleanup paths
- Extend dashboard guardrail coverage to explicitly enforce diagnostics protection for agent-generation.ts and ai-session-store.ts
- Stabilize plugin module reload imports by using temporary reload files with deterministic file URLs and cache updates
- Tighten CLI Vitest workspace cleanup to safely skip missing hidden dist directories during restore
2026-04-24 08:54:25 -07:00
Fusion
b48c840e77 feat(FN-2353): add structured diagnostics for remote route failures
- Add remote route diagnostic helpers in dashboard routes to classify timeout, transport, and unexpected errors with consistent context fields
- Apply structured runtime logging to mesh sync settings handling and both proxy paths (SSE and wildcard) for fetch and stream failure stages
- Preserve existing HTTP behavior while enriching diagnostics with node ID, upstream path, operation stage, and normalized error metadata
- Expand mesh and proxy route test suites with runtime logger harness assertions covering structured warn/error diagnostics
2026-04-24 08:54:25 -07:00
Fusion
40e44401f8 fix(FN-2371): preserve log severity in dashboard TUI capture
- Add severity control markers to core and engine structured loggers while keeping info logs on stderr transport
- Parse and strip internal severity markers in dashboard TUI console capture so logger.log entries render with info icons instead of error icons
- Expand dashboard TUI tests to cover captured console severity mapping and structured logger behavior, plus logger unit tests in core/engine
- Add a patch changeset for @runfusion/fusion describing the TUI log severity icon fix
2026-04-24 08:54:25 -07:00
Fusion
9ef39ef4d2 test(FN-2373): add regression coverage for title summarization chain errors
- Add a store regression test for the Promise-chain fallback path when title auto-summarization fails
- Simulate a thrown console.warn call to force execution into the outer catch handler
- Assert task creation still succeeds without a title and that structured error context is logged
2026-04-24 08:54:24 -07:00
gsxdsm
87f950e25d Merge pull request #4 from Runfusion/fix/sse-connection-leak
fix: prevent dashboard reload freezes after repeated refreshes
2026-04-24 08:53:50 -07:00
Aron Prins
fddcd92db5 test(FN-0000): drop flaky settings modal assertions 2026-04-24 15:21:04 +02:00
Aron Prins
9927778062 fix(FN-0000): kill dev server process groups 2026-04-24 14:32:16 +02:00
Aron Prins
9474e157dd test(FN-0000): mock full agent detail API surface 2026-04-24 13:47:12 +02:00
Aron Prins
b8012c2881 test(FN-0000): update SSE bus URL expectations 2026-04-24 13:23:44 +02:00
Aron Prins
a95e6b0124 fix(FN-0000): stabilize automation cron scheduling and SSE coverage 2026-04-24 12:51:53 +02:00
Aron Prins
0c64766b2a fix(FN-0000): prevent stale dashboard service worker reload traps 2026-04-24 11:38:20 +02:00
Aron Prins
8d985c468c fix(dashboard): close SSE EventSources on page unload to prevent freeze
After ~3 refreshes, the dashboard would hang on "Initializing dashboard..."
with all /api/* fetches stalling. Root cause: Chrome keeps HTTP/1.1 sockets
in its keep-alive pool across page navigations even after EventSource is
garbage-collected. Once 6 (the per-origin limit) are held, every new fetch
queues indefinitely and the app can't finish booting.

Fix, layered:

1. sse-bus.ts — pagehide/beforeunload listeners close all active channels
   and send a sendBeacon to /api/events/disconnect so the server forces
   the socket closed (socket.destroy) rather than waiting for the browser
   to notice. Uses a sessionStorage clientId to correlate.

2. api.ts — createResilientEventSource (used by planning / mission / slice
   stream endpoints) registers every handle in a module-level set and
   closes them all on pagehide/beforeunload. sse-bus doesn't see these
   streams, so it needs its own teardown.

3. sse.ts — server-side connection bookkeeping. Tracks managed SSE
   connections by clientId, supports client-triggered disconnect via
   POST /api/events/disconnect, stale-timer cleanup, and supersedes
   older streams when a client reconnects.

4. server.ts — exposes /api/events/disconnect and /api/events/keepalive
   under a dedicated 300 req/min rate limit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 11:09:29 +02:00
gsxdsm
b478c252e2 feat(FN-2399): merge fusion/fn-2399 2026-04-24 00:43:15 -07:00
gsxdsm
904ad4cf13 chore(release): v0.1.2
Version bump via changesets.
2026-04-24 00:39:37 -07:00
Fusion
ba9f9b76cf fix(FN-2355): improve AI route diagnostics and stabilize related tests
- Add structured ai-session diagnostics for summarize-title and agent-generation error paths in dashboard routes
- Emit debug-gated summarize request/model resolution diagnostics when FUSION_DEBUG_AI is enabled
- Add route tests that assert diagnostics payloads for summarize and agent generation failures
- Reduce test flakiness by increasing core Vitest timeouts and relaxing brittle extension-discovery argument matching
2026-04-24 00:21:23 -07:00
gsxdsm
b0ce28cea8 perf(test): halve vitest workers to avoid workspace-concurrency oversubscription
Reduce VITEST_MAX_WORKERS from 4 to 2 in root `test` script so the
2-package workspace-concurrency fan-out yields 4 total threads instead
of 8, eliminating nondeterministic @fusion/core timeouts under load.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 00:20:41 -07:00
Fusion
74fdb0baf8 fix(FN-2316): harden pi session message normalization 2026-04-24 00:20:41 -07:00
gsxdsm
71129ad968 fix(FN-2316): harden pi session message normalization 2026-04-23 23:38:05 -07:00
gsxdsm
422b324103 fix(FN-000): stabilize failing tests and trim slow waits 2026-04-23 23:11:58 -07:00
gsxdsm
b7233e833d feat(FN-2340): merge fusion/fn-2340 2026-04-23 23:02:38 -07:00
gsxdsm
10ea91a137 perf(dashboard): hoist agent-store setup to beforeAll in routes.test
The PATCH /tasks/:id/assign and Task checkout routes describe blocks
re-initialized a real AgentStore (sqlite init + createAgent) in their
beforeEach hooks, even though no test in either block mutates the agent
rows. Moving the agent setup to beforeAll while keeping the per-test
mock-store reset cuts ~20 sqlite init cycles across these two blocks.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:38 -07:00
gsxdsm
2f154321f5 perf(cli): skip native-binary build tests by default
The build-exe and build-exe-cross suites invoke `bun build` in beforeAll
hooks and pegged CPU for ~6 min on every test run (one cached-on-miss
build plus three unconditional cross-target builds). Move them to a
dedicated vitest project, skip them unless CI=1 or FUSION_TEST_BUILD_EXE=1
is set, and add cache guards so CI re-runs skip rebuilds when the target
binary already exists. With build-exe out of the default cli run, the
main config can enable fileParallelism.

Run on demand via `pnpm --filter @runfusion/fusion test:build-exe`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:38 -07:00
gsxdsm
aecd17bc69 feat(claude-cli): add Claude Opus 4.7 to the provider model list
The pinned @mariozechner/pi-ai catalog tops out at Opus 4.6 / Sonnet 4.6
/ Haiku 4.5. Append a Claude Opus 4.7 entry (1M ctx, 128k max out,
$5/$25 per MTok) with id-dedupe so it becomes a no-op once the upstream
catalog catches up. Sonnet 4.6 and Haiku 4.5 remain current per
https://platform.claude.com/docs/en/about-claude/models/overview and
are already in the catalog, so no other additions are needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:38 -07:00
gsxdsm
256ba0ee61 refactor(claude-cli): always load extension, gate via /api/models filter
Previously the vendored @fusion/pi-claude-cli extension was conditionally
loaded based on GlobalSettings.useClaudeCli. That forced a Fusion restart
every time the user toggled the provider card — confusing UX.

Key insight: pi-claude-cli registers a NEW provider id ("pi-claude-cli")
rather than overriding "anthropic", so loading it unconditionally is
safe — direct Anthropic auth and CLI-routed models coexist peacefully.
The extension also gracefully no-ops when the `claude` binary is missing
(see packages/pi-claude-cli/index.ts:106 — the throw is caught locally).

Changes:
 - serve/daemon/dashboard: always append the resolved pi-claude-cli path
   to discoverAndLoadExtensions, no settings lookup.
 - resolveClaudeCliExtensionPaths() takes no args now; always returns the
   resolved path.
 - /api/models filter flipped: hide provider === "pi-claude-cli" when
   the toggle is OFF (previously: restricted to those models when ON).
 - POST /api/auth/claude-cli drops restartRequired semantics — toggling
   now has immediate effect on the picker.
 - Provider card UX updated to match: "Claude-CLI-routed models are
   now visible/hidden from the model picker" instead of "Restart Fusion
   to activate".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
230de32d03 fix(dashboard): bump in-memory rate limits to avoid spurious 429s
The shared per-IP mutation bucket (30/min) made common dashboard actions
like Respecify fail with "Too many requests" after light activity. Raise
mutation to 600/min, api to 1000/min, sse to 60/min for the local-first
use case.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
836089fe5f fix(core): use query param instead of hash fragment for plugin cache-busting
Vite/Vitest's resolver treats `#` as part of the filesystem path in some
environments, causing ERR_MODULE_NOT_FOUND on plugin reload.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00
gsxdsm
ed4b7380a0 Revert "perf(test): parallelize harder — unlock worker count, split build-output, bump workspace concurrency"
This reverts commit 972ad0f9fa55dc1419660aba4758a9d3c325919a.
2026-04-23 23:02:37 -07:00
Fusion
ff515f0119 feat(FN-2369): merge fusion/fn-2369 2026-04-23 23:02:37 -07:00
Fusion
1b00478032 feat(prompts): require lint alongside tests and typecheck in agent instructions
Every agent-facing quality gate that used to pair tests with typecheck now
also includes lint. Specifically:

- core/src/types.ts: QA Check skill prompt runs lint, tests, typecheck (was
  tests only) and gates task_done() on all three.
- core/src/agent-prompts.ts + engine/src/reviewer.ts: "Do NOT issue REVISE"
  exclusion list now covers lint as well, so out-of-scope fixes that
  restore lint remain allowed (matches the already-lint-aware completion
  gate text at the top of the same prompts).
- engine/src/executor.ts: task_done() pre-flight checklist adds an explicit
  "if the repo has a lint command, run it and fix failures" bullet, mirrors
  the typecheck bullet, and expands the CRITICAL line from "ALL test
  failures" to "ALL lint, test, and typecheck failures".
- core/src/store.ts: default Step 2 checklist (Testing & Verification) now
  includes Lint and Typecheck alongside "All tests pass".
- cli/src/commands/plugin-scaffold.ts: generated plugin README and the
  "Next steps" CLI output include \`pnpm lint\` between install and test.

Existing prompts that already paired lint with tests+typecheck (the
Completion section, hard quality gates, triage testing requirements) are
unchanged.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:37 -07:00