Commit Graph

5462 Commits

Author SHA1 Message Date
gsxdsm
bc900a1a8c feat(FN-900): replace ChangedFilesModal with files tab in TaskDetailModal
- Add initialTab prop to TaskDetailModal to open directly on a specific tab
- Replace onOpenFilesForTask with onOpenDetailWithTab across App, Board, Column, WorktreeGroup
- Update TaskCard click handlers to open detail modal with files tab instead of separate modal
- Delete ChangedFilesModal component and useChangedFiles hook (296 + 78 lines removed)
- Remove associated tests (ChangedFilesModal.test.tsx, useChangedFiles.test.ts)
- Add changeset for patch release
2026-04-04 17:26:51 -07:00
gsxdsm
b2a8d0c6cc feat(FN-907): add word wrap toggle to diff viewer in TaskChangesTab
- Add word wrap state and toggle button to TaskChangesTab component
- Add CSS styles for word wrap toggle in diff viewer
- Add tests for word wrap toggle functionality
2026-04-04 17:25:08 -07:00
gsxdsm
9da06dbbde feat(FN-906): add file navigation to changes tab and reduce diff margins
- Add file navigation dropdown/keyboard support to the TaskChangesTab component
- Reduce horizontal margins in diff display for better readability
- Add comprehensive tests for file navigation behavior
- Include changeset for patch release
2026-04-04 17:07:12 -07:00
gsxdsm
da81737cc6 feat(FN-903): add middle truncation utility for file paths in dashboard
- Add truncatePath utility function with configurable segments and placeholder
- Apply middle truncation to file paths in ChangedFilesModal sidebar
- Apply middle truncation to file paths in TaskChangesTab
- Remove unused CSS truncation styles replaced by the new utility
- Add comprehensive test suite for truncatePath (106 tests)
2026-04-04 16:55:02 -07:00
gsxdsm
b4ed704a03 feat(FN-890): tokenized executor footer state backgrounds and accents
- Replace hardcoded hex colors in executor status bar CSS with CSS custom properties for state backgrounds and accents
- Add tests covering theme-aware CSS variable overrides for all executor states (idle, running, failed, etc.)
- Document the executor status bar theming in the dashboard README
2026-04-04 16:39:55 -07:00
gsxdsm
2363500ea5 feat(FN-887): widen model menu on mobile viewports
- Widen quick-entry Models menu to fill viewport on mobile (≤640px) with side padding
- Keep menu viewport-clamped to prevent horizontal crowding on small screens
- Update dashboard README with mobile model menu documentation
2026-04-04 16:31:30 -07:00
gsxdsm
e012abb637 fix(FN-880): prevent horizontal scroll in model dropdown
- Add overflow-x: hidden to dropdown container to prevent unwanted horizontal scrollbar
- Add min-width: 0 to flex children for proper text truncation
- Add tests for CustomModelDropdown overflow behavior
- Document the CSS fix in dashboard README
2026-04-04 16:21:53 -07:00
gsxdsm
d07bd52e12 feat(FN-834): add per-workflow-step model override UI and support
- Add model provider/model selection fields to WorkflowStepManager component
- Add dropdowns for choosing executor model per workflow step definition
- Wire executor to use per-step model overrides when configured
- Add comprehensive tests for WorkflowStepManager (340 lines)
- Add CSS styles for model selection UI in workflow step editor
- Update AGENTS.md and README.md with model override documentation
- Add changeset for published package bump
2026-04-04 16:00:53 -07:00
gsxdsm
47ccd20669 feat(FN-936): add modal description persistence for re-entry
- Add modalPersistence hook for saving/restoring modal state (description, goal) via localStorage
- Update PlanningModeModal to persist and restore description across re-opens
- Update SubtaskBreakdownModal to persist and clear description on resume flow
- Update MissionInterviewModal to clear goal after starting interview
- Add unit tests for modalPersistence hook
- Add integration tests for modal re-entry behavior across all three modals
- Add changeset for published package patch bump
2026-04-04 15:56:46 -07:00
gsxdsm
e4e0cadcb3 fix(FN-937): prevent setIsSaving error on unmounted component
- Add mountedRef to track component mount state in TaskDetailModal
- Guard setIsSaving(false) in finally block with mount check
- Prevents React state update on unmounted component warning
2026-04-04 15:23:34 -07:00
gsxdsm
4dbb372668 feat(FN-926): filter out files with empty diffs from file-diffs endpoint
- Filter files where diff body is empty (e.g., binary files, unchanged) from the /api/tasks/:id/file-diffs response
- Add tests verifying empty diffs are excluded while non-empty diffs are preserved
- Reduces noise in the dashboard diff viewer by omitting irrelevant file entries
2026-04-04 15:19:48 -07:00
gsxdsm
2d650eada7 chore(FN-939): rename pnpm workspace from kb to fusion
- Rename workspace name from kb-workspace to fusion-workspace in root package.json
2026-04-04 15:19:25 -07:00
gsxdsm
040e0e45a0 fix(FN-920): improve error handling in subtask breakdown SSE stream
- Handle empty error messages in subtask-breakdown session by falling back to 'Unknown error'
- Fix backend SSE routes to coerce error data to string and handle missing message
- Improve frontend connectSubtaskStream to validate parsed error data before displaying
- Add tests for error display in SubtaskBreakdownModal component
2026-04-04 15:13:28 -07:00
gsxdsm
0eb8d3b594 feat(FN-934): add active planning session badge to Header
- Add badge indicator to Planning button showing count of active background planning sessions
- Integrate useBackgroundSessions hook in App and Header components
- Add badge styles with pulse animation for active session indicator
- Add comprehensive tests for badge rendering and session count display
2026-04-04 15:10:11 -07:00
gsxdsm
a5567ad45c feat(FN-925): add memoryEnabled setting with UI toggle and engine integration
- Add memoryEnabled boolean setting to core types and default settings
- Add Memory section toggle to SettingsModal dashboard UI
- Integrate memoryEnabled check in executor and triage engine prompts
- Add tests for settings UI, executor prompt behavior, and triage prompt behavior
- Update SettingsModal section count test for the new Memory section
2026-04-04 15:06:57 -07:00
gsxdsm
9981822afb feat(FN-884): update TaskDetailModal tests for Logs tab and Commits tab structure
- Update tab navigation tests to reflect Logs subview model and conditional tab assertions
- Fix tab nomenclature in step progress tests (Agent → Logs)
- Update TaskDetails docs to reflect Commits tab and Logs subview structure
- Update README references for dashboard and root
2026-04-04 14:59:23 -07:00
gsxdsm
611bfe46e8 feat(FN-812): add first-run model onboarding modal and API key provider support
- Add ModelOnboardingModal component with provider selection, API key input, and model verification flow
- Add API key authentication support to SettingsModal with clear-key functionality
- Trigger onboarding from App.tsx when modelOnboardingComplete setting is false
- Add comprehensive tests for ModelOnboardingModal and SettingsModal authentication
- Document model onboarding flow and API key auth in AGENTS.md and README
- Add CSS styles for onboarding modal, provider cards, and auth section
2026-04-04 14:44:06 -07:00
gsxdsm
ea43787218 feat(FN-892): add planning mode multi-task creation with Break into Tasks
- Add generateSubtasksFromPlanning function to generate subtasks from planning session key deliverables
- Add POST /planning/start-breakdown and POST /planning/create-tasks API routes
- Add startPlanningBreakdown and createTasksFromPlanning frontend API functions
- Extend PlanningModeModal with Break into Tasks UI and subtask editing (drag-and-drop, dependency validation)
- Add comprehensive tests for generateSubtasksFromPlanning with edge cases
- Document planning mode multi-task creation feature in AGENTS.md
2026-04-04 14:25:34 -07:00
gsxdsm
2c1538b7c2 fix(FN-927): always show relative duration for CLI reset times
The guard `if (!window.resetText)` prevented overwriting the raw CLI
text (e.g. "Resets Apr 9 at 8pm") with a relative duration because
resetText was already populated from the parsed CLI line. Remove the
guard so the parsed date is always converted to "resets in 3d 8h".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 14:20:32 -07:00
gsxdsm
85065ed509 fix(FN-930): fix terminal WebSocket reconnection stale closure bug
- Add activeTab and connectionStatus to the subscription effect dependency array in TerminalModal
- Ensures WebSocket reconnects properly when terminal tab is reactivated or connection status changes
2026-04-04 14:19:24 -07:00
gsxdsm
864296edc2 fix: pre-bundle xterm packages to resolve MIME type error in terminal
Vite's dev server was returning HTML error pages instead of JS for
dynamically imported @xterm/* modules, causing 'text/html is not a
valid JavaScript MIME type' failures during terminal initialization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 14:02:13 -07:00
gsxdsm
0c00194d79 fix: repair pre-existing engine test failures from missing pi-ai mock
Add @mariozechner/pi-ai mock to restart.integration.test.ts and
project-runtime.test.ts to fix module linking errors. Fix call count
assertions in executor and restart tests to account for the
retry-without-task_done behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 13:59:08 -07:00
gsxdsm
eef87a2aea feat: add background AI sessions with persistent storage and SSE streaming
Introduces ai_sessions table (schema v9), AiSessionStore, and background
session support for mission interviews, planning, and subtask breakdown.
Adds BackgroundTasksIndicator component, SSE-based progress streaming,
and dashboard API routes for session management.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 13:42:02 -07:00
gsxdsm
4f2b840eb4 chore(FN-912): add changeset for terminal scrollback timing fix
- Add patch changeset documenting the terminal scrollback timing fix for @gsxdsm/fusion
2026-04-04 13:36:27 -07:00
gsxdsm
c609df7db5 feat(FN-924): add memory insights module with extraction settings
- Add MemoryInsightsEngine class for extracting insights from task memory
- Implement pattern, metric, trend, anomaly, recommendation, and summary extractors
- Add insight extraction settings fields (enabled, maxInsights, types, schedule) to ProjectSettings
- Export MemoryInsightsEngine and related types from @fusion/core
- Add comprehensive test suite covering all extractor types and edge cases (538 lines)
2026-04-04 13:25:22 -07:00
gsxdsm
13c13471d3 fix(FN-927): fix usage reset time parsing and display fallback
- Fix backend regex in usage.ts to correctly parse CLI date-based reset text format
- Add frontend fallback in UsageIndicator to display relative reset time when absolute date is unavailable
- Add tests for backend regex parsing (usage.test.ts)
- Add tests for frontend UsageIndicator component (UsageIndicator.test.tsx)
2026-04-04 13:22:55 -07:00
gsxdsm
dd8acb76b4 fix: resolve all 41 pre-existing dashboard test failures
- AgentsView: add missing fetchModels/fetchAgentStats mocks, update tests
  for new multi-step NewAgentDialog and ActiveAgentsPanel dual rendering
- routes-diff: rewrite tests to match new resolveDiffBase() two-dot syntax
- routes.test: fix spec/revise test — done→triage is valid per VALID_TRANSITIONS
- activity-feed CSS: replace hardcoded rgba(88,166,255) with color-mix token,
  fix var(--error) → var(--color-error)
- server/webhook/websocket tests: add getDatabase() mock for AiSessionStore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 13:17:03 -07:00
gsxdsm
cf4fe0277d feat: add AI-driven mission interview system (Factory.ai-style planning)
Add a conversational AI interview flow to the missions screen that
interviews users to break down missions into milestones, slices, and
features with verification criteria at every level.

Backend: Replace stubbed interview logic with real AI agent integration
using createKbAgent, SSE streaming, and robust JSON parsing. Wire up
all 5 placeholder mission interview route endpoints (start, respond,
cancel, stream, create-mission).

Frontend: New MissionInterviewModal component with conversational UI,
thinking output display, question renderers, and hierarchical plan
review/edit. Integrated into MissionManager with "Plan with AI" button.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 12:50:12 -07:00
gsxdsm
1b3eb7bf10 fix(FN-915): use getFusionDir() for agent storage location
- Add getFusionDir() method to TaskStore for resolving agent database path
- Update in-process-runtime to use getFusionDir() instead of hardcoded path
- Update dashboard routes AgentStore initialization to use getFusionDir()
- Add changeset for published package patch bump
2026-04-04 12:35:15 -07:00
gsxdsm
de074420d2 fix: defer stuck-kill requeue to executor finally block to prevent race
When the stuck task detector killed a task and immediately called
moveTask("todo"), the scheduler could re-dispatch the task before the
old execution's finally block cleared this.executing. The new execute()
call hit the guard and silently returned, stranding the task in
"in-progress" with no active session or worktree (seen on FN-810/FN-912).

Move the requeue responsibility from StuckTaskDetector.killAndRetry to
the executor's finally block, which runs after this.executing.delete().
The beforeRequeue budget check now runs before session.dispose() and its
result is passed via StuckTaskEvent.shouldRequeue → markStuckAborted().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 12:26:13 -07:00
gsxdsm
cfe770652b fix(FN-912): move scrollback buffer reset to WebSocket onopen handler
Move initialBufferRef reset from the beginning of connect() to inside
ws.onopen to ensure the buffer is fresh only when the new connection is
established. This prevents a race condition where the buffer could be
cleared before the WebSocket is ready, causing scrollback data to be
lost when terminal tabs are switched.
2026-04-04 11:48:38 -07:00
gsxdsm
fec4642003 fix(FN-911): close refine dropdown immediately on selection
- Close the refine model dropdown as soon as a selection is made instead of waiting for the next render cycle
- Add test verifying the dropdown closes immediately upon refine selection in QuickEntryBox
2026-04-04 11:37:44 -07:00
gsxdsm
94f035ca53 feat(FN-908): replace text input with CustomModelDropdown in NewAgentDialog
- Replace plain text input for model selection with CustomModelDropdown component in NewAgentDialog
- Add provider/model selection with grouped dropdown UI and search filtering
- Support editing existing agents with pre-populated model values
- Add comprehensive test suite (374 lines) covering rendering, interaction, and edge cases
- Wire up agent creation and editing flows to use the new dropdown for model selection
2026-04-04 11:34:26 -07:00
gsxdsm
a7c1d34fb9 feat(FN-905): add relative timestamps to agent log entries
- Display relative timestamps (e.g., '2m ago') alongside absolute timestamps in AgentLogViewer
- Add formatRelativeTime utility for human-readable time formatting
- Update existing and add new tests covering relative timestamp rendering
2026-04-04 11:32:00 -07:00
gsxdsm
9358483ca3 feat(FN-822): add visible stuck indicators on board and list with unified detection
- Unify stuck-task derivation using project settings (taskStuckTimeoutMs) instead of hardcoded values
- Thread taskStuckTimeoutMs through Board, Column, WorktreeGroup, and TaskCard components
- Add visual stuck indicator with pulsing animation on in-progress task cards
- Resolve merge conflicts with isSearchActive prop from main (both props coexist)
- Add taskStuck utility unit tests and update README with stuck indicator docs
2026-04-04 11:31:22 -07:00
gsxdsm
4602dc916e feat(FN-904): make dev script run build and typecheck before vite dev
- Update dashboard dev script to run vite build, tsc, and app typecheck before starting vite dev
- Ensures the project is fully built and type-safe before development server starts
2026-04-04 11:28:07 -07:00
gsxdsm
647bd75864 feat(FN-835): add script-mode workflow step execution with validation hardening
- Implement script-mode workflow steps that execute named commands from project settings with 2-minute timeout
- Harden PATCH /api/workflow-steps/:id validation to reject empty names, check resulting state validity
- Add comprehensive executor tests (420 lines) covering script mode execution, timeout, missing scripts, and prompt mode
- Add dashboard route tests for PATCH validation edge cases
- Update AGENTS.md and README.md with script-mode engine behavior documentation
2026-04-04 11:21:13 -07:00
gsxdsm
357086ab61 fix(FN-834): fix branch prefix drift, add merger branch guard, and fix test OOM
- Fix resolveBaseBranch to use stored branch name and consistent fusion/ prefix
  for both explicit deps and blockedBy paths (was using kb/ for blockedBy)
- Add main branch checkout verification in merger before squash merge to prevent
  feature code from landing on wrong branch lineage
- Align all branch prefix references from stale kb/ to fusion/ across executor,
  merger, store, and routes
- Fix executor test OOM by mocking merger fully, adding fake timers to retry
  tests, and switching vitest pool to vmThreads
- Update all test assertions to use fusion/ branch prefix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 11:11:59 -07:00
gsxdsm
d1da9721a1 feat(FN-881): add bounded bootstrap timeouts and xterm init watchdog
- Add bounded bootstrap timeouts with stale-result guards to useTerminalSessions hook
- Implement xterm init watchdog with distinct recovery path for terminal initialization failures
- Refactor TerminalModal component with improved error handling and timeout recovery
- Add comprehensive test suites for useTerminalSessions hook and TerminalModal component
- Update dashboard README with watchdog documentation
2026-04-04 10:48:23 -07:00
gsxdsm
4dc6ccfa78 refactor(FN-874): align TaskDetailModal tests and docs with unified Logs tab
- Rewrite TaskDetailModal tests to reflect the unified Logs tab (agent log + activity log merged)
- Update test assertions to match new tab structure and component behavior
- Update README to describe the unified Logs tab layout
2026-04-04 10:03:50 -07:00
gsxdsm
931e732335 feat(FN-893): suppress absolute reset timestamp for Claude weekly usage windows
- Hide absolute reset timestamp text when usage window is weekly (Claude's pattern) to avoid confusing countdown display
- Add isWeeklyWindow helper to detect 7-day window patterns in UsageIndicator component
- Add comprehensive tests for weekly window detection, timestamp suppression, and edge cases
2026-04-04 10:02:32 -07:00
gsxdsm
0207959552 feat(FN-826): add usage dialog with reset time visibility and Claude 5h tests
- Add Usage Dialog section to README dashboard features documentation
- Enhance reset time visibility in the UsageIndicator component
- Add comprehensive tests for Claude 5h usage scenarios (155 lines)
- Update dashboard styles for usage indicator improvements
2026-04-04 09:51:38 -07:00
gsxdsm
866b97a1c2 fix(FN-874): recover stuck-killed tasks reliably 2026-04-04 09:45:45 -07:00
gsxdsm
cbc87a43ca feat(FN-792): redesign Mission Manager detail hierarchy, actions, and responsive layout
- Redesign detail panel hierarchy with clearer visual structure and action layout
- Add responsive behavior for mission detail views across screen sizes
- Update MissionManager component with improved action buttons and layout
- Add comprehensive tests for MissionManager component (172 lines)
- Update Mission Manager description in README
2026-04-04 09:40:57 -07:00
gsxdsm
9bc8e79aad fix(FN-756): fix branch name prefix in prune tests and document stale worktree recovery
- Fix branch name assertion in executor test: use kb/ prefix instead of fusion/
- Add comprehensive tests for stale worktree and branch reference recovery (267 lines)
- Document stale worktree/branch recovery procedure in README
2026-04-04 09:26:39 -07:00
gsxdsm
0486e12c2e fix: retry with new agent session when task_done is not called
Instead of immediately failing when an agent finishes without calling
task_done, spawn a fresh session with a recovery prompt that asks the
agent to review the worktree state and complete the task. Only fail
if the retry also doesn't produce a task_done call.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-04 09:15:01 -07:00
gsxdsm
353be2ec5c docs(FN-808): document nested model menu and add regression tests
- Document nested model menu behavior in QuickEntryBox in AGENTS.md
- Add README section describing the model selection nested menu pattern
- Add regression tests for nested model menu submenu open/close behavior
2026-04-04 09:10:28 -07:00
gsxdsm
9900c2d115 fix: unify diff endpoints and show changed files on done task cards
- Server /tasks/:id/diff and /tasks/:id/file-diffs now both use
  resolveDiffBase() for consistent file lists across card and modal
- Both endpoints handle done tasks via mergeDetails.commitSha,
  returning structured { files, stats } from the merge commit
- TaskChangesTab uses fetchTaskDiff for all columns (no more
  fetchCommitDiff/parsePatch client-side path for done tasks)
- useChangedFiles hook simplified — server handles done tasks
- Done task cards show "N files changed" button using mergeDetails
- Updated tests for new unified data flow

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 08:55:46 -07:00
gsxdsm
4542d580c1 feat(FN-860): display planning/triage model in Agent Log and Task Detail
- Add Planning/Triage model resolution and display in AgentLogViewer header
- Wire planning model resolution into TaskDetailModal with model info tab
- Add comprehensive tests for AgentLogViewer and TaskDetailModal model display
- Document planning/triage model display feature in README
2026-04-04 08:52:42 -07:00
gsxdsm
7349e502bc feat(FN-879): add portaled model menu with layering and filter-input stability
- Port model menu dropdown to a portal for proper z-index layering above overlays
- Stabilize filter input behavior inside the portaled menu
- Add CSS styles for portal-based menu positioning and layering
- Add comprehensive tests for the portaled QuickEntryBox model menu
- Add changeset for the published package fix
2026-04-04 08:52:05 -07:00