refactor(mothership-chats): rename task feature to chat, move route, add redirect#4910
Conversation
…add redirect - Move workspace route /task/[taskId] -> /chat/[chatId] and add a permanent redirect in next.config so existing bookmarks/deeplinks keep working - Rename client hooks queries/tasks.ts -> queries/mothership-chats.ts with the mothership-chat-prefixed family (distinct from the existing deployed-chat hooks in queries/chats.ts to avoid query-key collisions) - Rename contract mothership-tasks.ts -> mothership-chats.ts (MothershipChat) - Rename lib/copilot/tasks.ts -> chat-status.ts (chatPubSub, ChatStatusEvent) - Rename use-task-events -> use-mothership-chat-events, use-task-selection -> use-chat-selection, and folder-store chat-selection methods - Update server-generated deeplinks (oauth callback, inbox response, inbox list) - Preserve wire/persisted/analytics values that cross process or deploy boundaries: Redis channel task:status_changed, SSE event task_status, MothershipResourceType 'task', posthog event names, drag/itemType discriminants. Unrelated scheduled-tasks and email-inbox tasks untouched
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview API and client layers swap Realtime status moves from Wire analytics, resource type Reviewed by Cursor Bugbot for commit d2e26d8. Configure here. |
Greptile SummaryThis is a thorough rename/refactor moving the Mothership "task" feature to "chat" across 57 files — route, hooks, contracts, store, components, and server-side URL generators — while carefully preserving backward-compatible wire values (Redis channel
Confidence Score: 5/5Safe to merge — this is a purely mechanical rename with no behavior changes on any hot path. Every renamed symbol has been updated consistently across routes, hooks, stores, contracts, and tests. Wire-level identifiers (Redis channel, SSE label, drag discriminants, analytics events) are intentionally preserved, and the permanent redirect in next.config.ts protects existing bookmarks. Type-check and test suite pass cleanly. The only finding is a cosmetic stale string in the search-modal filter key. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["Old URL\n/workspace/:wid/task/:chatId"] -->|"permanent redirect\n(next.config.ts)"| B["New URL\n/workspace/:wid/chat/:chatId"]
subgraph "React Query Cache"
C["mothership-chat-* keys\n(mothership-chats.ts)"]
D["chat-* keys\n(queries/chats.ts)"]
end
subgraph "Pub/Sub (preserved for rolling deploy)"
E["Redis channel: task:status_changed"]
F["SSE label: task_status"]
E --> F
end
subgraph "Renamed"
G["tasks.ts → mothership-chats.ts"]
H["lib/copilot/tasks.ts → chat-status.ts"]
I["use-task-events → use-mothership-chat-events"]
J["use-task-selection → use-chat-selection"]
K["store: selectedTasks → selectedChats"]
end
B --> C
C -.->|"no collision"| D
Reviews (2): Last reviewed commit: "refactor(mothership-chats): use skipToke..." | Re-trigger Greptile |
Drop the enabled + chatId! non-null assertion in favor of the skipToken pattern, matching useMothershipChats. Behavior-preserving.
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit d2e26d8. Configure here.
Summary
/workspace/[workspaceId]/task/[taskId]→/workspace/[workspaceId]/chat/[chatId]next.config.tsso existing bookmarks/deeplinks to the old/task/URL keep workingqueries/tasks.ts→queries/mothership-chats.tsusing amothership-chat-prefixed family — deliberately distinct from the existing deployed-chat hooks inqueries/chats.tsto avoid React Query cache-key collisionsmothership-tasks.ts→mothership-chats.ts,lib/copilot/tasks.ts→chat-status.ts,use-task-events→use-mothership-chat-events,use-task-selection→use-chat-selection, and the folder-store chat-selection methods/chat/URLIntentionally preserved (to avoid unintended side effects)
task:status_changedand SSE eventtask_status(kept identical so live status updates keep flowing across pods during a rolling deploy)MothershipResourceTypevalue'task'(stored in chat resources + sent to the sim-agent backend), plus the aligned dragtype/kindanditemTypeUI discriminantstask_request_started,task_message_sent, etc.) andresult_type: 'task'scheduled-tasks, email-inbox tasks, the sharedTaskicon glyph, Microsoft Planner tasks, Trigger.dev/background jobsType of Change
Testing
bun run type-check— passes (0 errors)bun run check:api-validation— passes/task/URLs, no dangling old symbols/imports, and audited every globally-renamed token to confirm zero collateral in unrelated filesChecklist