Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[DEPLOY]

merged#2689CedarCopilot

CedarCopilot wants to merge 1 commit into main from staging

Not deployedTimeline and evidence
  1. Opened
    Sep 4, 2026, 11:43 PM
  2. Sep 4, 2026, 11:50 PM
  3. Merged
    Sep 5, 2026, 12:48 AM
  4. Live on staging, live on prod, observed
    Pending
  5. Not deployed

    Not deployed

    Pending

Libra has no production signal for this change yet because it has not deployed. Libra checks hourly for 3 days after each deploy.

Greptile Summary

This PR updates task completion and reopening behavior, draft cleanup timing, document persistence handling, agenda synchronization, and sidebar conversation typing.

Two reliability gaps remain: reopening an agent-enabled task can be reported as successful even when its execution was not scheduled, and leaving the page during the completion Undo window can leave a Gmail draft behind.

Confidence Score: 4/5

Not safe to merge until reopened agent tasks cannot be confirmed as reopened after their required scheduling fails. The draft-cleanup gap is non-blocking but leaves stale Gmail drafts that require manual cleanup.

A reproduced task-execution failure materially affects the reliability of reopened agent tasks. A separate reproduced cleanup gap affects draft lifecycle behavior without blocking the core completion action.

Files Needing Attention: apps/server/src/trpc/routes/user-tasks.ts needs failure handling or durable retry for reopening schedules. apps/mail/modules/userTasks/hooks/use-optimistic-task-actions.ts needs durable delayed draft cleanup.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding, with the Reopen scheduling failure harness and the Reopen scheduling failure output supporting the evidence.
  • T-Rex produced a proof for a posted P2 finding, supported by the Draft cleanup reload harness and the related simulation and validation artifacts.
  • T-Rex performed a general contract validation showing the scheduler was invoked once, the task was committed as todo after a simulated queue failure, and a successful HTTP response was returned.
  • T-Rex validated draft cleanup on reload, demonstrating that cleanup is driven by the browser timer and the focused test sequence passes as expected.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (2)

  1. apps/server/src/trpc/routes/user-tasks.ts, line 1337-1351 (link)

    P1 Report reopen scheduling failures

    Reopening an agent-enabled task writes its status as todo, then logs and ignores a failed scheduling attempt before returning success. When scheduling infrastructure rejects the task before creating its queue or scheduling record, the user sees a successful reopen but the task will not receive its expected agent execution. Return the scheduling failure, or persist a retryable scheduling request, rather than confirming the reopen as successful. This must be fixed before merging.

    Knowledge Base Used:

Show production surfaces and changed-file mapping

Production surfaces

Libra has not measured any production surfaces for this change yet.

Changed files → surfaces

  • apps/mail/modules/agentCanvas/hooks/use-agenda-task-sync.tsno production surface mapped
  • apps/mail/modules/conversations/components/nextSteps/TaskBlock.tsxno production surface mapped
  • apps/mail/modules/conversationsPage/components/ConversationsSidebarBody.tsxno production surface mapped
  • apps/mail/modules/conversationsPage/components/ConversationsSidebarRow.tsxno production surface mapped
  • apps/mail/modules/conversationsPage/hooks/use-conversations-sidebar-conversations.tsno production surface mapped
  • apps/mail/modules/conversationsPage/utils/filterConversationsByQuery.tsno production surface mapped
  • apps/mail/modules/conversationsPage/utils/groupSidebarConversations.tsno production surface mapped
  • apps/mail/modules/threads/conversation-inbox/ConversationTaskRow.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskExecutionList.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskKanbanBoard.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskListView.tsxno production surface mapped
  • apps/mail/modules/userTasks/hooks/use-optimistic-task-actions.tsno production surface mapped
  • apps/mail/modules/userTasks/lib/pending-task-resolutions.tsno production surface mapped
  • apps/mail/tests/modules/agentCanvas/agenda-right-slot-state.test.tsno production surface mapped
  • apps/mail/tests/modules/agentCanvas/invoke-task-flow.test.tsxno production surface mapped
  • apps/mail/tests/modules/conversationsPage/utils/filterConversationsByQuery.test.tsno production surface mapped
  • apps/mail/tests/modules/userTasks/completeTaskUndoWindow.test.tsxno production surface mapped
  • apps/server/scripts/repair-frozen-agenda-yjs.tsno production surface mapped
  • apps/server/scripts/run-repair-frozen-agenda-yjs.mjsno production surface mapped
  • apps/server/src/mastra/tools/document/writeDocumentTool.tsno production surface mapped
  • apps/server/src/scripts/seed-coaching-agent.tsno production surface mapped
  • apps/server/src/services/document-saving/__tests__/applyUpdate-history-isolation.test.tsno production surface mapped
  • apps/server/src/services/document-saving/__tests__/persist-abort-contract.test.tsno production surface mapped
  • apps/server/src/services/document-saving/__tests__/writeFileAsYjs-abort.test.tsno production surface mapped
  • apps/server/src/services/document-saving/applyUpdate.tsno production surface mapped
  • apps/server/src/services/document-saving/hooks/__tests__/agenda-integrity.test.tsno production surface mapped
  • apps/server/src/services/document-saving/hooks/__tests__/agenda-to-tasks.test.tsno production surface mapped
  • apps/server/src/services/document-saving/hooks/agenda-integrity.tsno production surface mapped
  • apps/server/src/services/document-saving/hooks/agenda-to-tasks.tsno production surface mapped
  • apps/server/src/services/document-saving/hooks/playbook-compile.tsno production surface mapped
  • apps/server/src/services/document-saving/index.tsno production surface mapped
  • apps/server/src/services/document-saving/types.tsno production surface mapped
  • apps/server/src/services/document-saving/writeFileAsYjs.tsno production surface mapped
  • apps/server/src/services/documents/index.tsno production surface mapped
  • apps/server/src/services/task-scheduling/__tests__/complete-task-draft-cleanup.test.tsno production surface mapped
  • apps/server/src/services/task-scheduling/execution.tsno production surface mapped
  • apps/server/src/services/user-tasks/__tests__/cleanup-draft-pointer.test.tsno production surface mapped
  • apps/server/src/services/user-tasks/tasks.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/get-task-by-id-ticket-fields.test.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/user-tasks-conversation-scope.test.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/user-tasks-reopen-reschedules.test.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/user-tasks-task-access.test.tsno production surface mapped
  • apps/server/src/trpc/routes/user-tasks.tsno production surface mapped