Repository navigation
feat(desktop,host-service): delete legacy mastra chat in favor of chat-v3 - #6461
Conversation
|
Too many files changed for review (579 files, 100 file limit). |
|
Important Review skippedToo many files! This PR contains 578 files, which is 278 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (578)
You can disable this status message by setting the |
🧹 Preview Cleanup CompleteThe following preview resources have been cleaned up:
Thank you for your contribution! 🎉 |
|
Closing — not a sandbox prerequisite, and not worth holding open against a moving renderer. Why this was built: the original sandbox plan used a shared protocol package where every host-service procedure was a contract decision, so 14 chat procedures meant 14 decisions. That framing is gone (see #6457) — Why it isn't needed: of 437 deleted files, 374 are desktop renderer UI that sandboxes never run. Only 19 are host-service, and exactly one of those ( Why not just hold it open: a 437-file deletion accrues rebase tax against active renderer work, for a removal now gated on chat-v3 rollout rather than on sandboxes. Worth preserving when this is re-cut — the deletions were mechanical, these were not:
Branch |
…t-v3 Removes both legacy chat stacks: the v2 workspace ChatPane, the v1 ChatPane and its shared renderer/components/Chat tree, the host-service mastra runtime and its 14 chat procedures, the Electron-main chat-runtime-service, and packages/chat-legacy. This is a deliberate user-facing removal. Legacy chat had ~46 sustained users (3+ weeks, 20+ messages) out of 575 who touched it in 30 days; 87% sent fewer than 20 messages and 85-90% of first-timers never returned. chat-v3 (ChatV3Pane, behind the chat-v3 flag) is the replacement and is untouched. Also removed, because their only consumer was the chat runtime: host-service's model-providers subsystem (ModelProviderRuntimeResolver — verified zero remaining references to prepareRuntimeEnv/hasUsableRuntimeEnv), and the kind: "chat" agent concept in packages/shared, which made the superset agent unlaunchable once agents.run lost its chat branch. Provider auth survives intact: settings/models and onboarding still drive provider OAuth and API keys through provider-auth's auth namespace. Only its workspace namespace — slash commands, file search, MCP overview, which rode along in #6441 as hostages of a single router — is deleted. Components that non-chat surfaces imported from the deleted Chat tree were rescued rather than dropped: the provider OAuth dialogs and hooks, and the Tiptap prompt editor the v2 terminal rich input depends on. v1 tabs persist version 9 to 10 with a migration downgrading persisted chat panes to terminal panes, so old layouts keep rendering.
dd63f90 to
facdbbb
Compare
…flag (#6852) The Superset entry in useV2AgentChoices has been unlaunchable since #6461 removed the chat branch from agents.run, but every launcher still showed it unconditionally. Show it only to chat-v3 flag users (its eventual audience) instead of everyone. AutomationBody's "agent missing" warning used length > 1 as a loading sentinel, which relied on the entry always being present; it now uses the hook's isFetched plus a non-empty list. Claude-Session: https://claude.ai/code/session_01BU6ydkrZ2vYKKR9HQhryyf
…efix Review feedback. A persisted history entry can carry a search string or a hash, so matching only the bare path and a trailing slash let "/settings/models?tab=anthropic" survive the sweep and boot the renderer straight into Not Found — the exact thing the guard exists to prevent. The prefix now has to end on "/", "?" or "#", which also keeps a sibling route like "/settings/models-of-agents" from being swept by accident. Covered by four tests: a retired entry with the cursor on it, one carrying a search string and one carrying a hash, a sibling route that merely shares the prefix, and a history whose every entry is retired. Also drops a dead entry from the biome sync-subprocess ratchet. It named resolveAnthropicCredential.ts, deleted with the legacy mastra chat in #6461, so it belongs to the same cleanup as the rest of this branch. Claude-Session: https://claude.ai/code/session_01TzD4tqeanYqTMxpWRJGpwZ
…efix Review feedback. A persisted history entry can carry a search string or a hash, so matching only the bare path and a trailing slash let "/settings/models?tab=anthropic" survive the sweep and boot the renderer straight into Not Found — the exact thing the guard exists to prevent. The prefix now has to end on "/", "?" or "#", which also keeps a sibling route like "/settings/models-of-agents" from being swept by accident. Covered by four tests: a retired entry with the cursor on it, one carrying a search string and one carrying a hash, a sibling route that merely shares the prefix, and a history whose every entry is retired. Also drops a dead entry from the biome sync-subprocess ratchet. It named resolveAnthropicCredential.ts, deleted with the legacy mastra chat in #6461, so it belongs to the same cleanup as the rest of this branch. Claude-Session: https://claude.ai/code/session_01TzD4tqeanYqTMxpWRJGpwZ
579 files, −32,592 lines. Removes both legacy mastra chat stacks. chat-v3 (
ChatV3Pane, behind thechat-v3flag) is the replacement and is untouched — verified present along withpackages/chat,packages/chat-runtime, andhost-service/src/chat-v3.This is a deliberate user-facing removal
Legacy chat had ~46 sustained users (active 3+ weeks with 20+ messages), 25 of them heavy, generating 67% of messages. But of 575 users who touched it in 30 days, 87% sent fewer than 20 messages and averaged barely one active week, and 85–90% of first-timers never returned. Approved on that basis.
Deleted
Two removals beyond the obvious, both verified:
ModelProviderRuntimeResolverwas passed only toChatRuntimeManager; after deletion there are zero references toprepareRuntimeEnv/hasUsableRuntimeEnvrepo-wide. Terminal agents never used it.packages/shared— withagents.run's chat branch gone, thesupersetagent could never launch (nohostAgentConfigsrow carries that preset id), so leaving it would have meant an agent in the picker that always threw. Rippled into cli/sdk/mcp/automation dispatch. The presetmodeloverride went with it, since it existed solely for the chat agent.What survives, deliberately
renderer/components/ProviderAuth/, and the Tiptap prompt editor the v2 terminal rich input depends on moved torenderer/components/TiptapPromptEditor/. Both were importing from inside the deleted chat tree.chat-preferencesmoved to DEAD_KEYS per apps/desktop/AGENTS.md.Deps removed:
@mastra/memory,@ai-sdk/anthropic,@ai-sdk/openai,@ai-sdk/react,@mastra/core(desktop).mastracodestays — it backs provider-auth's credential storage and the mastracode terminal agent, which is unrelated to chat.Out of scope
The cloud chat router and
chat_sessions/chat_attachmentstables (FKs fromautomation_runs; separate cleanup).Verification
lint 0 · typecheck 0 (36/36) · sherif 0 · host-service 1071/1071 · desktop 2617/2617 · provider-auth 53/53 · full monorepo test 15/15 tasks green. Neither known host-service flake fired.
Summary by cubic
Remove legacy Mastra chat (v1/v2) from desktop and host-service and consolidate on chat‑v3. Old behavior: chat panes and a mastra-backed runtime. New behavior: only chat‑v3 (behind the
chat-v3flag); no"chat"pane type or sessionId-based resolution.chatRuntimeServicerouter; remove the"chat"pane type from UI state; update notifications resolver/tests to remove sessionId lookups; delete the legacy Chat UI tree.LocalModelProviderwiring.normalizeAgentPresetPatchno longer takes anAgentDefinition; call sites updated.@ai-sdk/anthropic,@ai-sdk/openai,@ai-sdk/react,@mastra/core, and@superset/chat-legacy.auth:routes.Migration/rollout
pane.type: "chat"; use terminal panes or the chat‑v3 pane flow.resolvePaneId(...)to the new signature withoutsessionId.chatRuntimeServiceTRPC router.renderer/components/ProviderAuth/andrenderer/components/TiptapPromptEditor/.@ai-sdk/*,@mastra/core,@superset/chat-legacy).modelResolverwhen starting the service.normalizeAgentPresetPatch, drop thedefinitionargument.Written for commit facdbbb. Summary will update on new commits.