Skip to content

fix(copilot): block duplicate chat deletes and leave the open chat first - #10476

Merged
waleedlatif1 merged 3 commits into
stagingfrom
fix/copilot-chat-delete-inflight
Nov 28, 2026
Merged

waleedlatif1 merged 3 commits into
stagingfrom
fix/copilot-chat-delete-inflight

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Workflow Copilot panel deletes chats through a new useDeleteCopilotChat mutation instead of a raw requestJson call, and disables the trash action while a delete is in flight, so a double-click no longer sends duplicate DELETE /api/copilot/chat/delete requests
  • The mutation's onSuccess prunes the chat's persisted draft and returns the list invalidation for the workflow captured at mutate time, so cleanup survives a Panel unmount and the action stays disabled until the refreshed list drops the row
  • Deleting the open chat clears the selection before the request and marks the workflow as auto-selected; the deleted chat-status event removes that chat's detail query, and a still-mounted observer (or auto-select reopening it from the unchanged list) would refetch the deleted chat
  • No server change: the owned-chat lookup filters on owner, so an already-deleted chat and another user's chat are indistinguishable there, and the not-found warning stays as is

Type of Change

  • Bug fix

Testing

  • bunx biome check on changed files
  • Existing lifecycle.test.ts and mothership/chat/stop/route.test.ts pass (server untouched)
  • Full type-check, audits and test suite left to CI

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Nov 28, 2026 11:53am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge; no new actionable issues remain.RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no new actionable issues remain.

Summary

Moves Copilot chat deletion into useDeleteCopilotChat.

  • Workflow Copilot leaves an open chat before deleting it and blocks repeat clicks.

waleedlatif1 accepted leaving a failed deletion unselected so it cannot interrupt a conversation started while deletion was pending.

Reviews (3) · Last reviewed commit: "fix(copilot): prune drafts and invalidat..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the fix/copilot-chat-delete-inflight branch from f1a0063 to c65c1d0 Compare November 28, 2026 11:53
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 384c0e0 into staging Nov 28, 2026
83 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/copilot-chat-delete-inflight branch November 28, 2026 12:01

This branch was previously deployed

1 inactive deployment
Preview — c65c1d08 Deployed Nov 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant