fix(ui): fix kb id extraction logic for resource, sync tags#3763
fix(ui): fix kb id extraction logic for resource, sync tags#3763TheodoreSpeaks merged 2 commits intostagingfrom
Conversation
|
@cursor @greptile review |
FindingsNo actionable defects found in this PR after reviewing the branch diff against I specifically verified:
Open questions / assumptions
Residual risk / testing gaps
Secondary summaryGreptile’s “safe to merge” conclusion matches my review: this is a tightly scoped bug fix with coherent server payload updates + client extraction/invalidation changes, and no obvious regression introduced. |
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR fixes two related bugs that together caused Mothership tag operations to open a "Resource not found" KB page and fail to refresh UI state. The root cause was that tag mutation responses return a Changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant C as Copilot
participant KBTool as knowledge-base.ts
participant DB as Database
participant RE as resource-extraction.ts
participant RR as resource-registry.tsx
participant QC as QueryClient
C->>KBTool: update_tag(tagDefinitionId)
KBTool->>DB: getTagDefinitionById(tagDefinitionId)
DB-->>KBTool: { knowledgeBaseId, ... }
KBTool->>DB: updateTagDefinition(...)
DB-->>KBTool: updatedTag
KBTool-->>C: { data: { id: tagId, knowledgeBaseId, ... } }
C->>RE: extractResourcesFromToolResult('knowledge_base', params, result)
Note over RE: Priority: args.knowledgeBaseId → params.knowledgeBaseId<br/>→ result.knowledgeBaseId → data.knowledgeBaseId → data.id
RE-->>C: [{ type: 'knowledgebase', id: kbId }]
C->>RR: invalidateResourceQueries(kbId)
RR->>QC: invalidate knowledgeKeys.lists()
RR->>QC: invalidate knowledgeKeys.detail(kbId)
RR->>QC: invalidate knowledgeKeys.tagDefinitions(kbId)
QC-->>C: UI refreshed with correct KB page
Reviews (2): Last reviewed commit: "Pass knowledge base id back on edit tag" | Re-trigger Greptile |
PR SummaryMedium Risk Overview Ensures tag edits propagate by including Written by Cursor Bugbot for commit 6968e42. This will update automatically on new commits. Configure here. |
* fix(ui): fix kb id extraction logic for resource, sync tags * Pass knowledge base id back on edit tag --------- Co-authored-by: Theodore Li <theo@sim.ai>


Summary
Mothership changes to tags aren't refreshed in the ui and open up a "Resource not found" kb page. This is because tag operations return tag_id, which we attempt to open up. Adjusted to attempt to access id first from
knowledgeBaseIdinstead of directly fromid. Also added query invalidation for tags on kb operations.Type of Change
Testing
Checklist
Screenshots/Videos