CedarCopilot wants to merge 27 commits into main from staging
Not deployed
Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.
Not safe to merge until the concurrent cleanup and cross-thread rewrite failures are fixed, and the repository type-safety requirement is satisfied.
### Issue 1
apps/server/src/services/user-tasks/tasks.ts:803-815
Two independent deletions of tasks that reference the same draft can both see the other task as live at this check. Each then clears only its own pointer and returns; after both tasks become deleted, no task references the Gmail draft and neither request deleted it. Serialize ownership by user and draft across every deletion path, or make the liveness check, pointer transition, and final cleanup decision atomic.
### Issue 2
apps/server/src/mastra/tools/event-execution/__tests__/draft-email-post-meeting-rewrite-thread.test.ts:90
This test casts the tool to `any` before asserting its desired execute shape, hiding type incompatibilities instead of checking the actual interface. This violates the repository directive against TypeScript assertions that silence type errors; the same `as unknown as DB` escape appears in `shared-draft-cleanup.integration.test.ts:132`. The repository requirement must be satisfied before merging by exposing or inferring the needed types without these assertions.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
This change improves draft validation, post-meeting rewrite handling, and shared-draft cleanup. Two reproduced failures still need correction: concurrent independent cleanup can orphan a shared Gmail draft, and an unrelated email-thread draft can be rewritten as though it belonged to the requested thread. The changed tests also contain prohibited type escapes that must be removed before merging.
Reviews (1) · Last reviewed commit: "Merge pull request #2877 from CedarCopil..."
Libra has not measured any production surfaces for this change yet.