improvement(copilot): drop unused columns from mothership chat detail reads#4640
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Migrates the mothership chat Reviewed by Cursor Bugbot for commit 48c026d. Configure here. |
Greptile SummaryThis PR introduces a lean
Confidence Score: 5/5Safe to merge — all column accesses on the narrowed type are present in CopilotChatDetailRow, downstream callers of resolveOrCreateChat only touch title or don't use chat at all, and the INSERT RETURNING projection is consistent with the new type. The change correctly narrows three independent read paths to a well-defined column subset. TypeScript enforces the boundary: any caller that tried to read a dropped field (e.g. model, pinned, previewYaml) would fail at compile time, and the PR description notes the type-check passed across 96 affected tests. The CopilotChatDetailRow type and copilotChatDetailColumns record are manually kept in sync, which is a minor maintenance concern but not a defect — the two definitions match today and a mismatch would produce a Drizzle type error at the call site. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Chat Detail Request] --> B{Chat Type?}
B -- mothership GET --> C[getAccessibleCopilotChatWithMessages]
B -- legacy copilot GET --> D[getAccessibleCopilotChat]
B -- resolveOrCreateChat --> E{chatId provided?}
E -- yes --> C
E -- no --> F[INSERT copilotChats .returning copilotChatDetailColumns]
C --> G[SELECT copilotChatDetailColumns id, userId, workflowId, workspaceId, type, title, messages, conversationId, resources, createdAt, updatedAt]
D --> H[SELECT * all columns incl. previewYaml, planArtifact, config, model, pinned, lastSeenAt]
G --> I[authorizeCopilotChatRow]
F --> J[CopilotChatDetailRow]
H --> I
I --> J
Reviews (1): Last reviewed commit: "improvement(copilot): drop unused column..." | Re-trigger Greptile |
Summary
getAccessibleCopilotChatWithMessagesthat selects only the columns chat-detail callers actually consume — dropspreviewYaml,planArtifact,config,model,pinned,lastSeenAtfrom the SELECTresolveOrCreateChat, andprocess-contentsto the lean helper;resolveOrCreateChat'sRETURNINGclause now uses the same projectionType of Change
Testing
Tested manually. Type-check, API contract audit, and 96 affected tests (15 files) all pass.
Checklist