The merge completes FN-3320 by implementing configuration tools for the agent system (`agent-tools.ts`), wiring them through the executor, and adding test coverage (`agent-tools-config.test.ts`). Documentation was updated in `AGENTS.md` and the engine tools reference, with minor updates to the agent
Fusion-Task-Id: FN-3320
The dashboard modules used a variable-specifier dynamic import
(`const m = "@fusion/engine"; await import(m)`) to defeat bundler static
analysis. tsup honored that and left the dynamic import in dist/bin.js,
so the published `@runfusion/fusion` package failed at runtime with
"createFnAgent2 is not a function" — `@fusion/engine` isn't on npm and
the silent catch set the binding to undefined. Replaces the trick with
static imports across planning, chat, subtask-breakdown, mission-interview,
agent-generation, ai-refine, roadmap-suggestions, milestone-slice-interview,
and routes. Core can't statically import engine (cycle), so it now exposes
setCreateFnAgent and engine wires itself in at module load. Documents the
pattern in AGENTS.md.
FixesRunfusion/Fusion#9.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The FN-2370 auto-resolved squash (de5dd6f7d) reverted three commits' worth
of refinements to the claude-cli provider because the branch contained
rebased duplicates of commits already on main. The auto-resolver picked
the older side line-by-line and dropped the newer.
Restored:
- /api/models filter logic (was inverted; emptied every model picker)
- Claude Opus 4.7 catalog entry in pi-claude-cli
- Provider card status text and toast messages (no longer claim a restart
is needed — the extension is always-loaded now)
- POST /api/auth/claude-cli returns restartRequired: false
Prevention:
- Regression tests on the /api/models useClaudeCli filter
- scripts/audit-squash-merge.mjs flags duplicate-cherry-pick risk and
touched-file overlap on any squash commit
- AGENTS.md documents the rebase-before-squash rule and requires the
merging agent to run the audit and triage every flagged item itself
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codify the patterns that the recent dashboard test trim removed so
they don't grow back: CSS-class permutation tests, field-presence
tests that duplicate payload-roundtrip tests, React.memo tautologies,
and structural CSS assertions. Keep FN-linked regression tests,
integration tests, and lean core/engine units unconditionally.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move the publishable CLI under the new @runfusion npm org for the first
public release. Reset version to 0.0.1 since the previous name was never
actually published. Rewrite packages/cli/README.md (the npm page) to
mirror the root README marketing — Fusion logo, reel GIFs pulled from
raw.githubusercontent.com, feature grid, tagline — and fix the stale
dustinbyrne/kb image link and ISC-vs-MIT license mismatch. Propagates
the name through root scripts, RELEASING.md, workflows, and docs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update AGENTS testing guidance to run pnpm test with VITEST_MAX_WORKERS=4
- Preserve the existing pnpm build verification command in the same testing section
- Rename engine export and call sites to use createFnAgent consistently across runtime flows
- Update core lazy engine loader and dashboard agent-generation/planning/chat paths to reference createFnAgent
- Refresh affected unit and integration tests, including renaming pi-create-kb-agent.test.ts to pi-create-fn-agent.test.ts
- Update AGENTS.md documentation references to match the new createFnAgent name
- Add an agentLogEntries table and schema migration updates for SQLite-backed agent log persistence
- Persist appended agent logs in SQLite and read task agent logs from the database instead of filesystem-only JSONL
- Import legacy agent log JSONL data into SQLite with type-safe handling for older log field shapes
- Preserve agent logs across task updates and archive flows, and update docs plus tests (including schema assertions) to cover the new behavior
- Add a changeset for @gsxdsm/fusion describing the agent log storage migration
- Remove legacy .fusion/memory.md fallback references and normalize prompts/docs to .fusion/memory/MEMORY.md
- Stop legacy mirror writes and fallback reads in core memory backend and project memory flows
- Update engine worktree boundary checks and tests for canonical memory file handling
- Align dashboard memory/settings surfaces and route tests with canonical memory behavior
- Add model-favorites persistence test coverage for mission interview and new agent dialogs
- Add list_agents tool for discovering agents by role, state, or includeEphemeral filter
- Add delegate_task tool for assigning work to a specific agent by ID
- Add comprehensive test coverage for both delegation tools in agent-tools-delegation.test.ts
- Update executor.ts to wire up delegation tools when agentStore is configured
- Document both tools in AGENTS.md and docs/agents.md
- Add GET /api/nodes/:id/settings endpoint to fetch remote node settings
- Add POST /api/nodes/:id/settings/push to push local settings to a remote node
- Add POST /api/nodes/:id/settings/pull to pull settings from a remote node
- Add GET /api/nodes/:id/settings/sync-status for sync diff summary
- Add POST /api/nodes/:id/auth/sync to sync model auth credentials
- Add POST /api/settings/sync-receive inbound settings endpoint
- Add POST /api/settings/auth-receive inbound auth endpoint
- Add GET /api/settings/auth-export to export local auth credentials
- Add comprehensive route tests for all sync endpoints
- Update AGENTS.md with Node Settings Sync API reference
- Change default global directory from ~/.pi/fusion to ~/.fusion
- Add migration logic to copy existing data from old directory to new location
- Update all core packages (store, settings, central-core, central-db) to use new default path
- Update all documentation references from ~/.pi/fusion to ~/.fusion
- Add test for ~/.pi/fusion migration path with updated mock paths
- Include changeset for @gsxdsm/fusion minor version bump
An AI review agent (FN-1506) killed the running dashboard by finding
the process on port 4040 via lsof and running kill -9, causing exit
code 137 (SIGKILL) with no logs. This adds multi-layer guardrails:
- AGENTS.md: project-level rule reserving port 4040
- Executor/reviewer system prompts: explicit prohibition on killing
port 4040 processes, with instruction to use --port 0 instead
- Core agent-prompts.ts: same guardrails in all prompt variants
- Reviewer told to issue REVISE if executor violates the rule
- SIGHUP handlers in dashboard.ts and serve.ts for resilience
- Background engine reconciliation in dashboard/serve startup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The merger's test/build verification, executor's worktreeInitCommand,
setupScript, and script-mode workflow steps all used execSync, which
blocks Node's event loop until the child process exits. A hanging
pnpm test could freeze the entire engine (no logs, heartbeats, or
other task progress) for the full 5-minute timeout.
Switch these call sites to promisify(exec) with awaited calls so the
engine keeps running while user-configured commands execute. Short
internal git plumbing (rev-parse, branch -d, worktree remove) still
uses execSync since those commands are bounded and measured in ms.
Document the rule in AGENTS.md under a new "Engine process rules"
section so future agents don't reintroduce blocking behavior.
Tests: update child_process mocks in merger.test, executor.test, and
restart.integration.test to route the new async exec through the
existing execSync mock and expose promisify.custom so destructuring
{ stdout, stderr } matches real child_process.exec semantics.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add FileMemoryBackend with atomic writes, persistence, and conflict resolution
- Add ReadOnlyMemoryBackend for read-only/external memory management
- Add memoryBackendType setting to select backend type (file or readonly)
- Add GET /api/memory/backend endpoint to query current backend status and capabilities
- Update AGENTS.md, README.md, and docs with architecture and settings guidance
- Add memory-backend.test.ts with comprehensive tests for all backends
- Add routes.test.ts coverage for /api/memory/backend endpoint
- Fix settings parity test to include new memoryBackendType key
Bundles staged work-in-progress modifications across multiple packages
(routes, store, agent-instructions, self-healing, QuickEntryBox, etc.)
plus the dashboard theme-data.css preload fix.
Note: an unstaged 621-line deletion in .fusion/memory.md was deliberately
NOT committed — it appears to be an accidental overwrite of architecture
notes and is left in the working tree for review.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add comprehensive Budget Governance documentation to AGENTS.md
- Document AgentBudgetConfig and AgentBudgetStatus interfaces
- Document budget reset behavior and API endpoints
- Add Dashboard Configuration section for budget settings UI
- Add Agent Budget API routes tests (GET/POST /api/agents/:id/budget)
- Test budget status computation with threshold and over-budget scenarios
- Test budget reset functionality with token counter clearing
- Remove extra closing brace in routes.test.ts
- Add agent picker dropdown to New Task modal for task assignment at creation time
- Include assignedAgentId in task creation payload when an agent is selected
- Add comprehensive regression tests for agent assignment functionality
- Update AGENTS.md documentation with New Task modal agent assignment details
- Add Budget Settings section to agent ConfigTab in AgentDetailView
- Section includes Token Budget, Usage Threshold, Budget Period, and Reset Day controls
- Budget settings are stored in agent.runtimeConfig.budgetConfig and persisted via PATCH /api/agents/:id
- Add comprehensive tests for Budget Settings UI interactions
- Document Budget Settings in AGENTS.md
- Deprecate autoAdvance field in favor of autopilotEnabled as the sole control
- Remove autoAdvance guard logic from MissionAutopilot engine class
- Simplify MissionManager UI to use single autopilot toggle with visual state indicator
- Update MissionAutopilot tests to use autopilotEnabled instead of autoAdvance
- Update MissionManager component tests for simplified UI
- Update AGENTS.md documentation to reflect the simplified autopilot model
- Refactor InlineCreateCard to display all action buttons (Plan, Subtask, Deps, Agent, Browser Verify, Preset, Models, Save) in one consolidated footer row
- Remove the separate inline-create-description-actions CSS class and associated styles
- Update InlineCreateCard tests to reflect the new consolidated control layout
- Update AGENTS.md documentation for InlineCreateCard controls description
- Update memory file with implementation notes
- Remove the quick-entry actions dropdown and expose Deps, Attach, Models, Agent, and Save controls directly in the expanded panel
- Simplify overlay state handling by dropping actions-menu logic and tightening Escape dismissal order for model/dependency popovers
- Update QuickEntryBox and ListView tests to assert the new inline controls and revised keyboard behavior
- Clean up quick-entry CSS by deleting actions-dropdown styles and adjusting expanded control layout/alignment
- Refresh AGENTS.md quick-entry documentation to match the inline control UX
- Add checkout lease types and conflict error exports, plus DB schema v20 migration for checkedOutBy/checkedOutAt
- Persist checkout lease fields in TaskStore and add AgentStore checkout/release/force-release/get-holder operations
- Add dashboard checkout API routes for acquire/release/force-release/status with explicit 409 conflict and 403 holder enforcement
- Enforce checkout ownership in heartbeat execution with graceful checkout_conflict exits when another agent holds the lease
- Expand core and dashboard test coverage for schema, store behavior, API routes, and leasing workflows, and document leasing behavior in AGENTS.md
- Update AGENTS.md examples to use FN-style task IDs instead of KB-style IDs
- Keep documented commit/message conventions consistent with the project task ID format
- Replace kb CLI command examples with fn equivalents across multi-project documentation
- Update project resolution and error message examples to reference fn commands
- Align terminology from kb to fn/Fusion in architecture and runtime sections
- Add schema v16 migration that creates workflow_steps and backfills rows from legacy config.workflowSteps data
- Update legacy file-to-SQLite migration to insert workflow step definitions into workflow_steps while preserving nextWorkflowStepId
- Refactor TaskStore workflow step create/list/get/update/delete paths to read and write workflow_steps instead of config JSON
- Adjust db migration tests and AGENTS.md storage docs to reflect the new workflow_steps table model
- Add aiSessionTtlMs and aiSessionCleanupIntervalMs project settings with defaults and bounds for cleanup scheduling
- Extend AiSessionStore cleanup to expire stale in-progress sessions, emit deletion events, and support start/stop scheduled cleanup loops
- Wire server startup/shutdown to load cleanup settings and manage the scheduled ai_sessions sweep lifecycle
- Align planning, subtask breakdown, and mission interview in-memory session retention to a 7-day TTL with shared deletion-driven cleanup
- Update schema/tests/docs for migration v15 ai_sessions indexing and end-to-end cleanup/TTL behavior stability
- Extend ntfy event types and default ntfyEvents to include awaiting-approval
- Send high-priority "Plan needs approval" notifications for awaiting-approval task updates with deep-link support
- Add Notifications settings checkbox handling for awaiting-approval event selection in Settings modal
- Expand notifier and settings modal tests for awaiting-approval defaults, toggles, filtering, and deduplication
- Update AGENTS.md ntfy documentation and sample config to include the new event
- Show resolved default executor, validator, and planning models in the task Model tab
- Pass merged settings into the Model tab from TaskDetailModal so default badges reflect effective runtime resolution
- Hot-swap active single-session executor models when task overrides change, including fallback to project defaults when overrides are cleared
- Add dashboard and executor tests for default model display, hot-swap behavior, fallback logic, and failure logging
- Document hot-swap behavior and limitations in AGENTS.md and add a patch changeset for @gsxdsm/fusion
- Map the workflow template icon key "globe" to the Globe icon in WorkflowStepManager
- Expand WorkflowStepManager tests to cover Browser Verification template rendering, icon display, and add-from-template behavior
- Update AGENTS.md workflow template documentation to include the new Browser Verification template and description
- Replace direct Deps/Models/Save controls with a single actions trigger in QuickEntryBox
- Add portaled actions dropdown behavior, including outside-click and Escape handling plus menu repositioning
- Add actions badge styling/count to reflect selected dependencies and model overrides
- Update QuickEntryBox/ListView tests and AGENTS.md docs to match the new actions-menu interaction flow