Commit Graph

17 Commits

Author SHA1 Message Date
Timothy Laurent
8853472c2c 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
Fusion
b8a32f8765 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
gsxdsm
a3ce8e1f8e fix(FN-XXX): unify codex auth and chat fallback 2026-05-03 23:08:05 -07:00
Fusion
1ff52a6f83 feat(FN-3336): recover chat isGenerating state on session load to prevent U
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
2026-05-03 16:51:01 -07:00
Fusion
0948be42fd feat(FN-3212): remove runtime memory-backend side-load, add regression test
Merged FN-3207, FN-3212, and FN-3242: removed runtime memory-backend side-loading in core, added comprehensive regression tests for QuickChat, chat routes, and SSE streams, and documented compact mobile chat dialogs in the dashboard guide. The refactor in `project-memory.ts` reduces complexity while

Fusion-Task-Id: FN-3212
2026-05-03 07:37:03 -07:00
Fusion
c729527fcc feat(FN-3062): add /clear command to Chat and Quick Chat, fix session banne
The merge adds a `/clear` command to both the Chat view and Quick Chat that clears transient chat state on session resets, with tests for all new hooks and components. It also persists session banner dismissals via a new `useSessionBannerPref` hook, adds a hide-banner setting, and preserves planning

Fusion-Task-Id: FN-3062
2026-05-01 13:20:50 -07:00
Fusion
50d194e27b feat(FN-2910): merge fusion/fn-2910
Commits merged:
- merge fusion/fn-2910

Fusion-Task-Id: FN-2910
2026-04-29 10:20:34 -07:00
Fusion
b248ffc6e6 fix(FN-2904): preserve quick chat streaming state on resume
- Keep active streaming responses alive when resuming an existing quick chat session instead of resetting stream state
- Update useQuickChat session-resume logic to only restart waiting indicators when appropriate
- Adjust QuickChatFAB waiting indicator behavior so it reflects real in-flight assistant activity
- Add focused hook and component tests covering same-session resume and waiting-indicator regressions

Fusion-Task-Id: FN-2904
2026-04-28 19:43:29 -07:00
gsxdsm
3031d05a68 fix(dashboard): clear all 661 test-file type errors
Production typecheck (tsconfig.json + tsconfig.app.json) was already
clean, but a third config that includes test files surfaced 661 errors
across 60+ test files — accumulated drift between mock fixtures and
production types. Six parallel typescript-pro agents fixed every one
without touching production code.

Per-scope before/after (errors → 0):
  ChatView                                                     183
  Mailbox + Agent suite (5 files)                              156
  Task / Modal suite (6 files)                                 127
  App + small components (12 files)                             96
  Hooks + api/auth (8 files)                                    48
  Long tail (32 files)                                          51
  -----------------------------------------------------------------
  Total                                                        661

Major fix categories:
- Untyped state objects inferring `never[]` / `null` literals (root
  cause of ~120 errors in ChatView alone — added a single
  `UseChatReturn` annotation)
- Mock objects missing fields that became required: `WorkflowStep.mode`,
  `ChatMessage.thinkingOutput / metadata`, `ChatSession.projectId`,
  `Task.log`, `ProjectHealth` fields, `PtyTerminalSessionInfo.createdAt`,
  `Agent.metadata`, `InboxResponse.total`, etc.
- Mock objects with stale fields that no longer exist:
  `AgentBudgetStatus.budgetPeriod`, `truncated` on log responses,
  `OutboxResponse.unreadCount`, `MergeResult.source/target/details`
- Modal props that became required (e.g. `PlanningModeModal.onTasksCreated`)
- String literals not in narrowed unions (`Column`, `WorkflowStepPhase`,
  `InsightStatus`, `AgentLogType`, etc.)
- `querySelector` returning `Element` cast to `HTMLElement` for
  `@testing-library/react`'s `within()`
- Vitest mock typing: `.mock.calls` access needing `vi.mocked(...)`,
  zero-param tuple handling, generic `vi.fn(() => [])` inferring
  `never[]`

Helpers introduced in test files (no shared infra):
- `makeSettings(overrides)` in ModelSelectorTab.test.tsx
- `makePromptOverrides(overrides)` in AgentPromptsManager.test.tsx
- `FileBrowserTestOverrides` type alias in FileBrowser.test.tsx
- `makeInboxResponse / makeOutboxResponse` in MailboxView.test.tsx

Verification:
- tsc -p tsconfig.json:        exit 0
- tsc -p tsconfig.app.json:    exit 0
- tsc -p tsconfig.test-check.json (new — includes test files): exit 0
- vitest run:                  9639 / 9641 (2 pre-existing failures
                               in terminal-mobile-keyboard-layout.test.ts
                               unrelated to this work; verified via
                               `git stash` + run on clean HEAD)

Adds packages/dashboard/tsconfig.test-check.json to keep this regression
guard available locally — same as tsconfig.app.json minus the test
exclude.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-27 19:59:52 -07:00
gsxdsm
83630a5193 feat(FN-2449): merge fusion/fn-2449 2026-04-24 08:55:02 -07:00
Fusion
ad9224c9b9 feat(FN-2306): add fresh quick-chat thread creation flow
- Add startFreshSession to useQuickChat so users can explicitly create a new persisted session for the current agent/model target
- Refactor session creation into a shared helper and track current session target to support fresh-thread creation without changing selection
- Add a New chat action to the QuickChatFAB header that starts a fresh thread while preserving active model/agent context
- Update quick chat hook/component tests to verify new-session behavior and message streaming targets
- Add header action styling for the new quick-chat controls
2026-04-23 10:24:19 -07:00
Fusion
19d62b41f5 refactor(FN-2162): rename kb-agent identifiers to fn-agent
- Rename core loader, dashboard server chat/planning routes, and frontend agent IDs/storage keys from kb-agent to fn-agent naming
- Update dashboard hooks and components (agent list, chat view, quick chat) to use the new fn agent key prefixes consistently
- Refresh engine, dashboard, core, and CLI tests/mocks to remove remaining kb-agent route and temp prefix references
- Update storage/gap-analysis docs to reflect fn agent key names and add a @gsxdsm/fusion patch changeset for the rename
2026-04-19 20:48:14 -07:00
gsxdsm
49fea9ede7 feat(FN-2017): merge fusion/fn-2017 2026-04-18 23:22:20 -07:00
Fusion
a63bca856e fix(FN-2060): preserve quick chat state on streaming errors
- Trigger onError for unexpected AbortError failures in streamChatResponse while ignoring user-initiated closes
- Keep quick chat user messages on send errors, reset streaming state, and reload messages from the server
- Persist partial assistant output (including thinking-only fallbacks) when AI processing fails mid-stream
- Add regression coverage for stream abort handling, quick chat error UX, and partial-response persistence
2026-04-18 20:56:12 -07:00
Fusion
57736beb06 fix(FN-2011): keep chat input responsive during streaming
- Make useChat and useQuickChat sendMessage synchronous and update consumers to call it without awaiting
- Allow ChatView and QuickChatFAB inputs to remain editable while responses stream
- Keep quick chat send disabled during active streaming to prevent concurrent sends
- Add hook and component tests for synchronous sendMessage and non-blocking input behavior
2026-04-17 15:38:32 -07:00
Fusion
43f0e279f5 feat(FN-2006): split quick chat flows into agent and model modes
- Add explicit agent/model mode toggles to QuickChatFAB and NewChatDialog
- Update session target logic so model mode starts chats with the KB agent while agent mode uses selected agents
- Clear opposite selections when switching modes and adjust placeholders/disabled states to match active mode
- Expand ChatView and QuickChatFAB tests to cover toggle visibility, mode switching, and session payload behavior
- Add useQuickChat coverage to verify agent-only switchSession calls omit model parameters
2026-04-17 15:02:54 -07:00
Fusion
214a831c2f feat(FN-1993): enable model-targeted quick chat sessions
- Add KB agent fallback support in useQuickChat and allow switching sessions by agent plus model override
- Introduce session target key matching so same target reloads messages while different model selections create distinct sessions
- Update QuickChatFAB to lazy-load models, show model override UI, and keep quick chat usable for model-only conversations
- Add and expand hook/component tests to cover model selection flows, KB session creation, and default-model reset behavior
2026-04-17 03:47:21 -07:00