Commit Graph

395 Commits

Author SHA1 Message Date
Fusion
45a9bdbbdc feat(FN-3855): add chat stream reattach, hybrid room responder policy, mesh
This merge introduces a model selector to the Insights view with favorites, provider filtering, and configured-only options (FN-3842/3843), alongside chat stream reattach support for dashboard chat recovery. It adds mesh lease recovery semantics and a manager to the engine for improved node resilien

Fusion-Task-Id: FN-3855
2026-05-09 13:21:47 -07:00
gsxdsm
434e216cc2 Merge pull request #56 from timothyjlaurent/timothyjlaurent/Anthropic-error
fix: settings scope leak, insights model selector & provider filtering
2026-05-09 10:58:48 -07:00
Fusion
df6956cec6 feat(FN-3843): add chat stream reattach support
Adds the changeset for FN-3843, completing the chat stream reattach feature for the `@runfusion/fusion` CLI package.

Fusion-Task-Id: FN-3843
2026-05-09 10:44:29 -07:00
gsxdsm
7b6a470329 Merge branch 'main' into timothyjlaurent/Anthropic-error 2026-05-09 10:42:33 -07:00
Fusion
a2258b811f fix(FN-3838): suppress suspended-tab chat load failure toasts
- Add visibility suspension hook to detect tab-hidden periods during chat loading
- Update useChat and useQuickChat to suppress load-failed toasts triggered by tab suspension resumes
- Expand hook test coverage for suspension timing and toast suppression behavior
- Add plugin authoring documentation updates and include FN-3838 changeset

Fusion-Task-Id: FN-3838
2026-05-09 10:31:05 -07:00
Fusion
7cb13439d3 feat(FN-3550): add pending approval badges to agent views and header
Added pending-approval badge indicators across the agent detail view, agents overview, mailbox, header, and mobile nav, wired through new and existing agent/mailbox APIs, with test coverage and documentation updates.

Fusion-Task-Id: FN-3550
2026-05-09 10:31:05 -07:00
Fusion
9d1c05a7d9 feat(FN-3166): remove dashboard roadmap backend and add reports plugin scaf
Completes the FN-3166 multi-step removal of the legacy dashboard roadmap feature (backend routes, frontend API wrappers, nav state), along with FN-3792 deep-link URL support, and initial reports plugin scaffold with WhatsApp dedupe retention pruning.

Fusion-Task-Id: FN-3166
2026-05-09 10:31:04 -07:00
Fusion
18413a1c42 feat(FN-3792): add /tasks deep-link support with theme-data URL resolution
Adds a `/tasks` deep-link that rewrites legacy hash-style URLs on the client and redirects root-absolute paths on the server (FN-3792), along with a new `fusion-plugin-reports` scaffold including manifest, settings, and notification service improvements (FN-3778, FN-3790); also adds a session switch

Fusion-Task-Id: FN-3792
2026-05-09 10:31:04 -07:00
Fusion
12bad74955 feat(FN-3800): add session switcher to chat header and mobile switcher
This merge delivers five features: a session switcher for the chat header with mobile-aware dropdown styling and proper ARIA state, mailbox notification events with deep-link highlighting to the unread task, a fix for org chart connector endpoints in wide subtrees, a correction to merge finalize so

Fusion-Task-Id: FN-3800
2026-05-08 22:25:47 -07:00
Fusion
9c86771295 fix(FN-3760): add SSE first-event watchdog for legacy chat streams
- Add a first-event watchdog in legacy chat SSE handling to prevent hangs before initial stream data
- Cover watchdog behavior with legacy chat stream API tests
- Add hook-level regression tests for useChat and useQuickChat first-send stream scenarios
- Include a changeset for @runfusion/fusion patch release

Fusion-Task-Id: FN-3760
2026-05-08 20:45:48 -07:00
Fusion
ccefdd2c52 feat(FN-3509): document node mapping availability UI in dashboard guide
Documents the node mapping availability UI in the dashboard guide.

Fusion-Task-Id: FN-3509
2026-05-08 18:44:16 -07:00
Fusion
51e42cb0b5 feat(FN-3759): fix stale refs in useChat and useQuickChat queue flush handl
Merged branch adds FN-3759 queue flush ref fixes for `useChat` and `useQuickChat` hooks (with expanded regression test coverage), extracts the roadmap UI into a standalone plugin with schema hook and store bootstrap, ships FN-3281 review revisions with dashboard/plugin integration updates, and resol

Fusion-Task-Id: FN-3759
2026-05-08 17:52:27 -07:00
Fusion
d20d45ea58 fix(FN-3161): migrate roadmap dashboard surface to bundled plugin
- Move RoadmapsView UI, hooks, and tests from dashboard app into fusion-plugin-roadmap
- Replace the built-in roadmaps route/nav wiring with plugin view registration and host rendering
- Add bundled plugin view registration bootstrap in dashboard startup
- Update roadmap plugin build/test config and add FN-3161 removal changeset

Fusion-Task-Id: FN-3161
2026-05-08 16:51:07 -07:00
Fusion
f528d7cc55 feat(FN-3749): repoint roadmap type imports to plugin package
Fixed FN-3749 by repointing roadmap type imports from their original location to the plugin package across the legacy API, RoadmapsView component, and useRoadmaps hook.

Fusion-Task-Id: FN-3749
2026-05-08 13:29:45 -07:00
Fusion
d90d66538a feat(FN-3737): add even realities integration research report
Adds a new Even Realities integration research report to the documentation.

Fusion-Task-Id: FN-3737
2026-05-08 10:41:59 -07:00
gsxdsm
0746260544 fix(dashboard): memoize normalized shell state to stop render thrash
normalizeShellState rebuilds the object and its profiles array on every
call. useShellConnection was calling it during render, so consumers that
put state.profiles in a useEffect dep array (AppInner does, for the
shell-connection status effect) re-ran the effect on every render. The
async getShellConnectionNativeResult resolution then triggered another
render, feeding the loop. On desktop it stabilized; on iOS Safari it
could pin the main thread.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 08:37:26 -07:00
Fusion
845272effa test(FN-3729): add eval dashboard coverage
- Add EvalsView test coverage for eval runs entry rendering
- Add useEvals hook tests for response handling
- Add dashboard eval routes tests to verify API behavior
- Wire EvalsView with the additional exercised path

Fusion-Task-Id: FN-3729
2026-05-08 04:21:20 -07:00
Fusion
a6c4ee2b8c feat(FN-3406): add shell context hook plumbing for dashboard
Adds a new `useShellContext` hook with tests to the dashboard, integrated into `App.tsx` and `Header.tsx` to provide shell context plumbing throughout the UI.

Fusion-Task-Id: FN-3406
2026-05-07 23:21:05 -07:00
Fusion
6f3173abe7 feat(FN-3506): add discovery contract and integrate remote node discovery i
Merges node discovery onboarding (FN-3506) with two steps: a pre-registration discovery contract wired into the AddNodeModal UI, and full remote discovery integration with documentation. Also adds a local embedded runtime manager to the desktop app (FN-3404) and wires permanent-agent approval contex

Fusion-Task-Id: FN-3506
2026-05-07 23:21:05 -07:00
Fusion
faaa99e768 feat(FN-3505): add node onboarding mapping flow with asset-gated bundling
- Add onboarding project-mapping API contracts and dashboard UI wiring in AddNodeModal/NodesView
- Persist node-to-project mappings with rollback-safe failure handling and expanded hook/API test coverage
- Document node onboarding mapping behavior in architecture and multi-project docs
- Add tsup bundle asset gates for openclaw bridge and droid runtime, with changesets and bundle output tests

Fusion-Task-Id: FN-3505
2026-05-07 19:29:54 -07:00
Fusion
e411e3ce06 feat(FN-3403): add shell multi-profile support with connection manager onbo
Merges shell multi-profile support for desktop (FN-3403) — spanning new connection-manager flows, shell onboarding interoperability, mobile connection profiles, desktop IPC/shell-settings plumbing, and tokenized titlebar styles — with a secondary migration of the WhatsApp plugin to the Baileys pairi

Fusion-Task-Id: FN-3403
2026-05-07 18:35:45 -07:00
Fusion
f43a5fd029 feat(FN-3394): add evals dashboard view with API routes and client hooks
Adds a full evals dashboard view (FN-3394) with a client hook, server-side read routes, and navigation integration across the Header and mobile nav, backed by comprehensive tests. Wires Hermes chat message tools with mailbox behavior documentation (FN-3620), and extends the agent heartbeat and tools

Fusion-Task-Id: FN-3394
2026-05-07 17:24:11 -07:00
Timothy Laurent
dbe5b02024 feat(insights): thread model selection through useInsights hook
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-07 14:09:39 -07:00
Fusion
9057421112 feat(FN-3091): add plugin view remount routing test coverage
Adds test coverage for plugin view remount routing behavior in the App component.

Fusion-Task-Id: FN-3091
2026-05-07 08:49:18 -07:00
Fusion
1a0124c5da feat(FN-3080): document graph navigation canonicalization in plugin authori
Adds documentation for graph navigation canonicalization (FN-3080) covering plugin authoring and dashboard usage, along with a changeset for the `@runfusion/fusion` package release.

Fusion-Task-Id: FN-3080
2026-05-06 22:59:51 -07:00
gsxdsm
c9bbd7d43e fix(dashboard): parse Codex reset_at as epoch ms or seconds
Codex returns weekly window reset_at in milliseconds in some cases,
which was being multiplied by 1000 and producing nonsensical reset
countdowns and pace calculations. Route through _parseResetTimestamp
so both formats work, and add a regression test.

Also tightens comments in useMobileKeyboard / ChatView around why
visualViewport scroll events skip offsetTop updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 22:17:35 -07:00
Fusion
ad60886794 fix(FN-3624): harden mobile chat keyboard layout behavior
- Update ChatView keyboard spacer styling to keep viewport layout stable on mobile
- Adjust ChatView viewport handling logic to better align chat body with keyboard transitions
- Add ChatView regression tests covering mobile layout and keyboard interaction scenarios
- Add useMobileKeyboard hook tests to lock keyboard metric behavior and prevent regressions

Fusion-Task-Id: FN-3624
2026-05-06 21:55:22 -07:00
gsxdsm
8ec6c1086f Revert "fix(dashboard): lazy-init useMobileKeyboard so remount has no stale render"
This reverts commit 3f5d01f4d4.
2026-05-06 21:41:16 -07:00
gsxdsm
3f5d01f4d4 fix(dashboard): lazy-init useMobileKeyboard so remount has no stale render
When ChatView remounted (e.g. tab switch with keyboard still up), the
hook started with keyboardOpen=false and corrected itself only after
the effect ran. That single stale-state render briefly unhid the
executor status bar, which appeared as a blank pane covering half the
input box before the next state update settled it.

useState initializers now call getKeyboardMetrics() lazily on first
render so the very first paint already reflects the live keyboard
state.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 21:38:50 -07:00
gsxdsm
9a35f4f006 fix(dashboard): add rAF stability poll for keyboard re-snapshot
Tab/page switches with the keyboard up sometimes still left the
chat-thread anchored wrong because the timed re-reads (50/200/500ms)
missed the actual settlement frame on slower devices.

updateWithTail now also kicks off a rAF poll that re-reads metrics
each frame until offsetTop is stable for 2 consecutive frames or 1.5s
elapses. Combined with the extended timed tail (now adds 1000/1500ms),
this should catch both fast and slow iOS settlement paths without
indefinite polling.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 21:36:31 -07:00
Fusion
46f3ac2114 feat(FN-3618): surface provider icons in settings and dropdowns
Completes Step 3 of FN-3618 by surfacing AI provider icons throughout the Settings modal and model dropdowns, updating both the component styles and adding integration and unit tests to cover the new icon display behavior.

Fusion-Task-Id: FN-3618
2026-05-06 21:36:31 -07:00
gsxdsm
81e47e50eb fix(dashboard): re-snapshot keyboard metrics on focusin and page restore
Switching away from the chat view and back left the hook with stale
metrics — keyboardOpen was false at remount even though the system
keyboard was still visible, so the .chat-thread transform never
re-applied and the message list anchored too high. focusin and
synchronous reads also captured offsetTop mid-transition.

Adds a tail of delayed re-reads (50ms, 200ms, 500ms) on focusin,
visibilitychange, and pageshow so iOS has time to settle before the
final snapshot is taken.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 21:16:33 -07:00
gsxdsm
21b01f8f56 fix(dashboard): pin --vv-offset-top to resize/focus, ignore pan scrolls
iOS fires visualViewport scroll events at 60fps during a pan with the
keyboard up. Routing those through React state and into the .chat-thread
translateY(--vv-offset-top) transform amplified the pan into a visible
judder + ~300px shift + body background exposure.

useMobileKeyboard now uses two listeners: a full update (resize +
focusin/focusout) that re-snapshots all metrics including offsetTop, and
a scroll-only update that updates only height/keyboardOpen. offsetTop
is therefore frozen between keyboard open/close events — the transform
correctly compensates for iOS's initial visualViewport shift on focus
without following pan-time movement.

Restores the translateY anchor (so the thread isn't off-screen on
first focus) while keeping the swipe-jitter fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 20:58:04 -07:00
Fusion
d791fa90ab feat(FN-3608): update dashboard chat documentation
Updated the dashboard chat documentation in the user guide with a minor addition.

Fusion-Task-Id: FN-3608
2026-05-06 19:55:55 -07:00
Fusion
2140148fe2 feat(FN-3609): split TaskDetailModal tests into focused suites
This merge splits the monolithic TaskDetailModal test file into six focused test suites (rendering, attachments/tabs, definition/actions, inline-editing/integrations, models/progress/workflow, responsive/dependencies), adds a changeset for the test isolation baseline, fixes chat SSE optimistic echo

Fusion-Task-Id: FN-3609
2026-05-06 16:05:44 -07:00
gsxdsm
cd845d39be perf(merger): skip redundant in-merge verification and lockfile-stable installs
Two cuts to wasted work in the merge verification loop:

1. After the in-merge fix agent runs, fingerprint the working tree
   (`git diff HEAD` + `git status --porcelain`, sha256). If the post-fix
   fingerprint matches pre-fix and is non-empty, the agent didn't actually
   change anything — re-running the same failing command can only yield
   the same failure, so log and report the attempt as unsuccessful without
   paying the test/build cost. Empty fingerprints (snapshot tooling failed)
   fall through to the existing re-run path so we never silently swallow a
   real fix.

2. Inside `syncDependenciesForMerge`, hash the active lockfile and compare
   against `node_modules/.fusion-install-marker` (written after each
   successful install). When they match, skip `pnpm install
   --frozen-lockfile` even if `package.json` is staged. Covers the common
   case where `package.json` changes but the lockfile doesn't, and
   amortizes install across auto-recovery re-enqueues that hit the same
   worktree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 12:24:57 -07:00
gsxdsm
9087239078 chore(dashboard): drop dead reportDashboardPerf client and its log file
The /_perf/dashboard-load server route no longer exists, so every
reportDashboardPerf() call was a silently-swallowed 404. Remove the helper
in legacy.ts plus its five call sites in App.tsx / useProjects.ts (the
companion console.log lines stay), and drop the dashboard-perf.log entry
from the test-isolation runtime ignore list since nothing writes that file
anymore.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 12:14:26 -07:00
Fusion
f499f10818 feat(FN-3564): isolate plugin loader test state to prevent cross-test conta
Refactored plugin-loader tests and implementation to isolate plugin test contamination, improving test independence in `@fusion/core`.

Fusion-Task-Id: FN-3564
2026-05-06 02:14:05 -07:00
gsxdsm
b312ca4122 fix(dashboard): null WebSocket handlers before close to stop terminal tab doubling
Creating a new terminal tab caused every pty data chunk (including
keystroke echo) to render twice in xterm. The connect-effect's
`contextChanged` dep flips true→false in the same render cycle as
the new connection: the effect re-runs, React calls cleanup which
closed the still-CONNECTING WS without nulling its handlers, then
connect() opens a fresh WS. The ghost socket's onmessage continued
firing on the shared `onDataCallbacksRef` Set, delivering each chunk
twice (and producing the "WebSocket is closed before the connection
is established" warning). Null onopen/onmessage/onclose/onerror in
both cleanup() and connect()'s pre-close branch.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-06 00:05:55 -07:00
Timothy Laurent
2746015fc7 test(dashboard): add regression tests for quick chat init fixes
Six new tests covering the three bugs fixed in the previous commit:

- Retry limit: stops showing toasts after 3 consecutive failures,
  resets counter on success
- Skip flag: startFreshSession sets/clears skipNextSessionInitRef,
  creates new session even when existing one exists
- Ref stability: switchSession reads activeSession from ref so it
  correctly detects "same session" and skips re-initialization

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 16:43:54 -07:00
Timothy Laurent
5e5b40079a fix(dashboard): prevent quick chat init race condition and infinite retry loop
Three interacting bugs caused "Failed to initialize chat" toast spam and
prevented fresh session creation:

1. Race condition in handleCreateFreshSession — setting chatMode/
   selectedAgentId before startFreshSession triggered the session-init
   useEffect, which called switchSession and resumed the old session
   instead of creating a new one. Fixed with skipNextSessionInitRef.

2. Infinite retry loop — shouldRetrySessionInit retried indefinitely
   when initializeSession failed, producing unbounded toast spam.
   Fixed with a 3-retry cap (initRetryCountRef).

3. Cascading re-renders — switchSession depended on activeSession in
   its closure, getting a new identity on every state change and
   re-triggering the consumer's useEffect. Fixed by reading
   activeSession from a ref instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-05 16:31:49 -07:00
Timothy Laurent
ac74cb0d6d feat(FN-002): enable browser back-button navigation within the SPA dashboard
Previously the back button left the dashboard page entirely because
useNavigationHistory was only enabled for mobile viewports. Now it's
enabled for all viewports — desktop and mobile — so the browser back
button dismisses modals and reverts view changes within the SPA.

Changes:
- Enable useNavigationHistory for desktop (enabled: true instead of enabled: isMobile)
- Remove all isMobile ? historyAwareHandler : plainHandler ternaries
- Always use navigation-aware handlers (openDetailTask, openSettingsWithNav, etc.)
- Update JSDoc to reflect desktop support
2026-05-05 15:06:17 -07:00
Fusion
0aef085f13 feat(FN-3368): tighten research view test coverage and resolve dashboard ty
This merge introduces an eval automation domain store with persistence schema and a plugin dashboard view registry (FN-3512/FN-3513), adds scheduled eval batch architecture documentation (FN-3388), and includes substantial test coverage for Research routes and hooks (FN-3368 steps 1-3). The branch a

Fusion-Task-Id: FN-3368
2026-05-05 13:05:57 -07:00
Fusion
d7880c66b0 feat(FN-3157): add plugin dashboard view registry with nav integration
Merged FN-3157 to add a plugin dashboard views system, including a plugin view registry with lazy loading, navigation integration for Header and MobileNavBar, a usePluginDashboardViews hook with cache and refetch support, and tests covering the no-loader path. Also added documentation in `docs/PLUGI

Fusion-Task-Id: FN-3157
2026-05-05 12:14:20 -07:00
gsxdsm
b4a2e7a486 feat(chat): unify QuickChat backend path and consolidate render toggle
Backend
- chat.ts now routes both regular chat and QuickChat through
  createResolvedAgentSession instead of branching to createFnAgent for
  the no-runtime-hint case. This removes the divergent path where
  pi-ai's cleanupSessionResources(sessionId) could tear down resources
  the next generation depends on.
- sendMessage's finally only disposes the agent if it still owns the
  activeGenerations slot. A newer generation that has pre-empted us
  cleans up its own agent in its own finally — disposing here would
  yank the underlying CLI process out from under it.
- __setCreateFnAgent test helper now mirrors its mock into the
  createResolvedAgentSession slot so existing test setups still work
  after the unification.

Frontend
- Extract createChatStreamHandlers (RAF coalescing, accumulators,
  tool-call dedup, fallback handling) — useChat and useQuickChat were
  duplicating ~85 LOC each. Both now compose the shared factory.
- Move shared chat types into chatTypes.ts. The hooks re-export them
  for backward compatibility with existing consumers.
- Removed per-message Markdown/plain-text eye toggles. A single
  thread-level toggle in the chat header now flips every assistant
  bubble (including the streaming one) between rendered Markdown and
  plain text.
- Model-only chats hide the per-message agent identity row entirely;
  the model name is already in the thread header.

Tests
- Updated ChatView tests to reflect the new render-toggle contract
  (single header toggle drives all bubbles) and the model-only avatar
  suppression.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 11:04:48 -07:00
gsxdsm
ba6666fe5f fix: planning modal full-screen height on mobile
Two related bugs left the Planning Mode modal stuck at partial height on
mobile. useModalResizePersist replayed desktop-saved pixel dimensions
that overrode the mobile 100dvh rule, and React reconciled removed CSS
custom properties to empty string rather than calling removeProperty(),
which on iOS Safari defeated the var() fallback after keyboard dismiss.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 07:44:56 -07:00
Fusion
9e2a8006b9 feat(FN-3430): preserve and consume final assistant done payload
This merge adds done-payload snapshot handling across the chat system (FN-3430), normalizing how final assistant messages are preserved and consumed in the dashboard hooks, plus it normalizes dashboard mailbox and user identity for inter-agent messaging (FN-3484) and introduces plugin workflow step

Fusion-Task-Id: FN-3430
2026-05-05 06:42:18 -07:00
Fusion
c5e680db76 feat(FN-3466): add mutation coverage for agent view refreshes
Adds deterministic split-pane refresh behavior to the Agents views (AgentsView and AgentDetailView), with comprehensive test coverage for the mutation refreshes in the detail pane and the agents hook.

Fusion-Task-Id: FN-3466
2026-05-05 06:32:33 -07:00
Fusion
cdb64e008d feat(FN-3432): document chat streaming recovery guarantees in architecture
Added documentation for chat streaming recovery guarantees to the architecture docs.

Fusion-Task-Id: FN-3432
2026-05-05 00:11:02 -07:00
Fusion
b45b4dd17a feat(FN-3315): add test coverage for archived insights in three test suites
Adds test coverage for archived insights across the core store, `InsightsView` component, and `useInsights` hook — 156 lines of new tests covering FN-3315.

Fusion-Task-Id: FN-3315
2026-05-04 23:47:26 -07:00