Test FN-3314 completes its final step by refining an auth route assertion in the agents routes test, ensuring the test accurately validates the expected behavior.
Fusion-Task-Id: FN-3314
Combined both branches: TaskStore import from main + rmSync import
from our branch (needed for fresh DB test cleanup).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
When flushAgentLogBuffer() requeues valid entries on transient failure,
the timer was cleared but never re-armed, leaving entries in memory
indefinitely. Now schedules a retry after AGENT_LOG_FLUSH_MS.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two fixes from CodeRabbit review:
- Add MAX_AGENT_LOG_BACKLOG cap (5000 entries) to prevent unbounded memory
growth during prolonged SQLite outages. Oldest entries are dropped when
cap is exceeded.
- Only assign this._db/this._archiveDb after init() succeeds. On failure,
close the DB handle before throwing so callers never get a partially
initialized instance.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges origin/main to bring in the droid runtime plugin (needed by
plugin-loader test) and all recent changes. Adds a "Build plugins"
step to pr-checks.yml so plugin dist/ directories are compiled before
tests run — fixes ERR_MODULE_NOT_FOUND for hermes and droid plugins.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Addresses CodeRabbit TOCTOU concern: querying live task IDs inside the
transaction ensures the check and inserts are atomic under SQLite locking,
preventing FK violations from concurrent deletes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixed QuickChatFAB styling to align with the design token system, replacing hardcoded CSS values with consistent token variables in the component's stylesheet.
Fusion-Task-Id: FN-3266
Fixes FN-3112: Updates NodesView CSS to use tokenized border-radius and transition values from the design system instead of hardcoded pixel values, ensuring consistency with the dashboard's established token variables.
Fusion-Task-Id: FN-3112
This merge introduces a droid runtime plugin system with event bridge and process management (FN-3228), stabilizes plugin workspace verification gates and suppresses placeholder plugin shells in onboarding/settings flows (FN-3071), tokenizes danger/error styling in task detail components (FN-3350),
Fusion-Task-Id: FN-3071
Fixes task detail modal danger/error styling by switching to token-based CSS variables for consistent theming across dark and light modes.
Fusion-Task-Id: FN-3350
- Throw from init() when integrity check fails and recovery doesn't help,
preventing writes to a known-corrupt database
- Only drain buffer on successful flush; requeue valid entries on transient
failures (busy/IO) so they aren't silently lost
- Add spy on flushAgentLogBuffer in deleteTask test to prove flush-before-delete
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges FN-3336 to recover chat streaming state on page reload — adds `isGenerating()` and `getGeneratingSessionIds()` to `ChatManager`, enriches the session API to surface active-streaming sessions, and makes `useChat` and `useQuickChat` hooks restore the `isGenerating` flag when loading existing se
Fusion-Task-Id: FN-3336
Merged two features: FN-3334 introduces a new `autoReloadOnVersionChange` setting with a toggle in the Settings modal, version-check logic in the dashboard, and corresponding tests; FN-3335 fixes worktree project root resolution in `createFnAgent` and the skill resolver, with tests for both paths. S
Fusion-Task-Id: FN-3334
The merge lands the mesh configuration system (FN-3111) with type definitions, a `MeshConfigGenerator` service using a new `DockerClientService.recreateContainer()` method, and backend API routes for managing Docker-based mesh nodes. It also adds a "New Chat" button to the ChatView header on desktop
Fusion-Task-Id: FN-3111
Merges FN-3110 to add Docker provisioning support across the stack: TypeScript types and DockerProvisioningService in core, API routes in dashboard for provisioning operations, a useDockerProvisioning hook for frontend integration, and a DockerProvisioningStatus UI component — all covered by unit an
Fusion-Task-Id: FN-3110
- Move integrity check before SCHEMA_SQL writes (was after, contradicting comment)
- Log error message in checkpoint recovery catch block
- Make flushAgentLogBuffer private
- Move deleteTask flush inside withTaskLock to prevent race
- Use try/finally in flush so splice always runs on failure
- Filter stale task entries during flush to prevent buffer poisoning
- Add flush before getAgentLogsByTimeRange for read consistency
- Clean up leaked temp dir in fresh DB test
- Fix false-positive buffer-capacity test (query DB directly)
- Rename misleading "single flush" test title
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Strengthens regression test coverage for worker-budget behavior in the vitest workers test suite, adding 14 lines to cover edge cases.
Fusion-Task-Id: FN-3263
- Flush buffer before appendAgentLogBatch to prevent rowid ordering
inversion when callers interleave buffered and direct writes (P1)
- Wrap size-triggered flush in try-catch for consistency with timer path
- Move bumpLastModified inside transactions for atomicity
- Expose db.path getter and include DB path in all flush error logs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Merges FN-2999 research hardening (idempotent cancel/retry routes, aligned SSE event wiring, and cleaned status handling in the core research store and orchestrator) plus UI improvements to AgentDetailView header actions and planning disclosure UX in the modal, with a CSS token fallback fix in Scrip
Fusion-Task-Id: FN-2999
Ensures operators can identify which database has integrity issues
when multiple DB instances are running.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Move integrity check before migrations/seeds to avoid writing to a
corrupted database (makes corruption worse)
- Fix buffer swap-before-commit hazard: entries are now only removed from
the buffer after the transaction succeeds
- Add try-catch to timer-triggered flush to prevent uncaught exceptions
from crashing the process
- Log warning in close() catch instead of silently swallowing errors
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The agentLogEntries table was doing individual auto-committed INSERTs,
creating extreme WAL pressure that caused recurring B-tree corruption.
This adds three WAL PRAGMAs (aggressive autocheckpoint, size limit,
synchronous=NORMAL), a write-behind buffer for agent log entries, and
a startup integrity check with auto-recovery attempt.
Refs: Runfusion/Fusion#24
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This merge adds Docker connectivity management to Fusion (FN-3109), introducing a Docker client service in `@fusion/core` with typed interfaces for daemon connection configuration (host, socket path, TLS). The dashboard gains a `DockerTargetSelector` component for choosing between local socket and T
Fusion-Task-Id: FN-3109
Merged FN-3207 and FN-3242: streamlined the memory backend by removing the runtime side-load pattern in `project-memory.ts` (simplified from 25+ lines), added regression tests across core, engine, and CLI bundle to catch the import issue at build time, and updated ChatView with a CSS fix for file me
Fusion-Task-Id: FN-3207
Adds durable insight lifecycle management to the Fusion system, including a bounded insight run executor, storage contracts for insight and research data, and API integration through the insights routes. Legacy schema compatibility is stabilized, and lifecycle safeguards are documented in the archit
Fusion-Task-Id: FN-3013
Companion to the per-rootDir Database cache: when an AgentStore is
closed, drop it from the cache so the next instantiation opens a
fresh connection instead of handing out the closed handle. Also
tolerate "database is not open" on close, since multiple AgentStore
instances now share one underlying Database.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The dashboard re-instantiates AgentStore on every /api/agents request, and
each instance was opening a fresh Database — re-running schema migrations
and PRAGMA integrity_check on the full file. On a multi-hundred-MB DB that
was 3-7s per request and leaked file handles. Sharing a cached Database
keyed by rootDir reduces it to a one-time process cost.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Speeds up task-list load and interaction for projects with 100+ tasks.
- Migration 59 adds idxTasksColumn and idxTasksUpdatedAt; listTasks()
filters by "column" on every board load and SSE/refresh paths sort by
updatedAt, so each query was previously a full table scan plus a temp
B-tree sort.
- Debounce handleEmbeddedOpenDetail in ListView so rapid keyboard/mouse
navigation no longer fires a heavy /tasks/:id (log + comments) per
selection; stale-target requests short-circuit.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`TriageProcessor.finalizeApprovedTask` (added in FN-3056) called
`store.updateTask({title})` while the task was still in column='triage',
which triggered a pre-existing regen path in `TaskStore.updateTask` that
overwrote the agent's just-written specification with the bootstrap stub
(`# {id}: {title}\n\n{description}\n`). Tasks shipped to `todo` (and
through to `done`) with empty 70–200 byte specs while the executor only
saw the original one-line user description. The same regen path also
silently dropped `## Review Level` / `## Frontend UX Criteria` and any
section outside a fixed whitelist whenever a non-triage task's title or
description was edited.
Replaces the regen with wrapper-shape-exact stub detection (compare to
the bytes `createTask` would have written for the pre-update title and
description) plus surgical edits for real specs: title changes splice
only the leading `# ...` heading, description changes rewrite only the
body of `## Mission`, and every other section is preserved verbatim.
`finalizeApprovedTask` now applies the prompt-declared title after
`moveTask("todo")` as defense in depth. New regression tests cover real
specs surviving title sync, long bootstrap stubs, stubs whose body
contains `##` markdown or `**Created:**` text, and the end-to-end
triage finalize sequence on a real `TaskStore`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This merge lands FN-3015's insights feature: it adds persistence-backed coverage for the insights routes, expands the insight store lifecycle tests, closes route validation regressions, and fixes workspace verification gates. The implementation in `insights-routes.ts` was streamlined, and a new rese
Fusion-Task-Id: FN-3015
Merge brings FN-3067 UX revisions across onboarding components, including reduced ModelOnboardingModal complexity, new fallback styling for PluginSlot, and polish to OnboardingDisclosure, OnboardingResumeCard, and PostOnboardingRecommendations with minor updates to PlanningModeModal and SettingsModa
Fusion-Task-Id: FN-3067
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
The merge brings in a fix (FN-2998) that scopes the bottom safe-area padding in ResearchView to mobile devices only, correcting an over-application of the padding on desktop or larger screens.
Fusion-Task-Id: FN-2998
Split packages/dashboard/app/__tests__/api.test.ts (~6.4k lines) into per-area files (auth, git, missions, projects, settings, tasks), and src/__tests__/routes.test.ts (~20k lines) into per-area files (agents, auth, automation, git, github, planning, settings, system, tasks, tasks-ops). The monolith files were dominating wall-clock for the dashboard suite under file-parallel execution.
Also document in packages/core/vitest.config.ts why the core suite cannot move to "threads": vitest-setup gates per-worker cwd on isMainThread (false in worker_threads, so isolation breaks), and setup-test-isolation writes process.env.HOME unconditionally (threads share env, so concurrent workers race).
Drop an unused execFileSync import from scripts/test-with-lock.mjs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- pnpm build now excludes @fusion/desktop and @fusion/mobile by default
(recursive build still available as pnpm build:all). Saves time on
workspace-wide builds that don't need the native shells.
- Hoist the per-package max-worker computation into a shared
packages/core/src/__test-utils__/vitest-workers.ts util. Every
vitest.config.ts now calls computeMaxWorkers(), which honors
VITEST_MAX_WORKERS, FUSION_TEST_TOTAL_WORKERS, and a per-config
defaultCap, clamped to cpus-1.
- pnpm test sets VITEST_MAX_WORKERS=2 so the workspace run keeps total
fan-out modest with --workspace-concurrency=2.
- Switch dashboard vitest pool from forks to threads so jsdom/React
suites share a V8 heap instead of duplicating ~500MB per worker.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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>
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