Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(threads): a thread marked done stays gone, plus the branch's task-ticket, Slack-scoping and agenda work

merged#2571CedarCopilot

CedarCopilot wants to merge 2 commits into staging from feat/slack-style-reactions

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Aug 24, 2026, 4:01 PM
  2. Aug 24, 2026, 4:28 PM
  3. Merged
    Aug 24, 2026, 4:53 PM
  4. Live on staging
    Aug 24, 2026, 4:53 PM
  5. Live on prod
    Aug 24, 2026, 4:53 PM
  6. Observed 2 days
    Aug 24, 2026, 4:53 PM
  7. Pipelines steady after this deploy
    Aug 24, 2026, 4:53 PM
  8. Pipelines steady after this deploy
    Aug 24, 2026, 4:53 PM
  9. Unobserved

    Live on prod, no production signal yet

    Aug 26, 2026, 5:32 PM

Behaviors Libra is checking

Signed-in application routes use “Cedar” as the browser-tab title while marketing routes retain the marketing title.Inconclusivelow confidence

OTEL fallback found no prod spans matching apps/mail root meta function since deploy.

prod, checked Aug 26, 2026, 2:10 PM
Conversation context cards summarize open tasks as a collapsed count that users can expand, keeping other deal context visible by default.Inconclusivelow confidence

OTEL fallback found no prod spans matching ThreadContextCards TasksCard since deploy.

prod, checked Aug 26, 2026, 2:10 PM
Editing an agent-generated reply shows only the editable draft content instead of the previously quoted email history and renderer styles.Inconclusivelow confidence

OTEL fallback found no prod spans matching stripQuotedForEditing since deploy.

prod, checked Aug 26, 2026, 2:23 PM
Sending an agent draft that already contains a Gmail quote does not append the quoted thread a second time.Inconclusivelow confidence

OTEL fallback found no prod spans matching constructReplyBody since deploy.

prod, checked Aug 26, 2026, 2:23 PM
An open Slack thread’s empty chat view prioritizes linked-deal context and deal suggestions, removing the redundant generic thread-action prompt block.Inconclusivelow confidence

OTEL fallback found no prod spans matching cedar-os slackThread empty-chat layout since deploy.

prod, checked Aug 26, 2026, 3:23 PM
Context cards for an open Slack channel show the channel’s own linked conversation rather than stale context from a previously open conversation.Inconclusivelow confidence

OTEL fallback found no prod spans matching ThreadContextCards selectContextCardsConversationId since deploy.

prod, checked Aug 26, 2026, 3:52 PM

Failures attributed to this change

No prod customers are affected while this is only in staging. If promoted, customer impact is not proven from the retained evidence. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

single_user

staging, first seen Aug 24, 2026, 11:09 PM

Libra has verdicts on 0 of 14 tracked behaviors on prod; 14 are still being checked. Libra checks hourly for 3 days after each deploy.

Summary

27 commits off staging. The newest , and the reason this opened now , is the round-2 fix for "threads marked done come back to the inbox"; the rest is the task-ticket view, Slack container scoping, and the daily-agenda split that accumulated on this branch.

Archived-thread guard (8f9a83d8b)

Round 1 treated the optimistic removal as an edit and repaired the one window it could name , a listThreads response issued inside the archive round-trip , by re-applying the removal once, the instant the mutation settled. That assumed a 227,380 ms round-trip. Staging measures mail.markDone at up to 7381 ms, and all three resurrections prod ever recorded landed 15.7,18.2 s after the click, every one a fetch-response , seconds after the one-shot repair had already run, with nothing left to oppose them.

So the removal becomes an invariant instead of an edit. While a thread is guarded, any write to a mail.listThreads query that reintroduces it is repaired immediately , late fetch response, IndexedDB restore, side-inbox prefetch and fetchNextPage alike , so we no longer have to name the guilty write. The guard is time-boxed at 60 s; markActive, undo and mutation rollback each call releaseArchivedThreads first, so a legitimate return still lands.

Suppressions now report server-side. The previous round's diagnostic was PostHog-only and the browser reporting the bug sends PostHog nothing , 66 archives on staging produced zero client events , so the fix could never be verified. mail.reportListSuppression writes a structured log:

filter @message like /"message":"mail.listSuppression"/

Two new regression tests cover the exact prod timing (a stale response landing after the mutation settles) and the bulk-archive case; the harness installs the guard the same way QueryProvider does.

Rest of the branch

Task-ticket view (phases 1,6), Drive files grouped by folder, Slack channel access by membership + container-scoped reads, user_id dropped from the Slack/LinkedIn message tables, meeting visibility follows the deal rather than row ownership, the daily agenda moved to its own automation-only skill so creating a task no longer messages the user, and assorted table/document/notify fixes.

Test plan

  • pnpm run autofix:local green on the merged tree: oxlint clean, deps:check clean, 2515 Jest tests, 7265 Vitest tests.
  • Merged origin/staging (4 conflicts resolved: task-update processor field merge, agenda-format.md, tasks/SKILL.md , staging's morning-run edits ported into the new daily-agenda skill , and the saveDraftTool drafting mocks, which follow this branch's applySignature rename).
  • Two branch-only oxlint failures cleared along the way (68af306bf, 583af93c2).

Follow-ups

  • The guard's suppression log is the verification path , after deploy, check CloudWatch for mail.listSuppression to confirm whether late writes are still arriving and from which source.

🤖 Generated with Claude Code

Greptile Summary

The PR introduces a durable archived-thread suppression guard and combines substantial task-ticket, agenda, channel-scoping, Drive, drafting, and schema work.

  • Replaces one-shot archived-thread repair with a time-boxed cache invariant and server-side suppression reporting.
  • Adds the task-ticket view, source-thread persistence, editable task properties, and revised task-opening behavior.
  • Reworks Slack and LinkedIn message ownership around channel containers and membership, including removal of message-level user_id columns.
  • Splits daily-agenda automation into its own skill and updates related task, document, meeting, and drafting flows.

Confidence Score: 3/5

The PR is not safe to merge until the conversation hydration and LinkedIn suggestion queries are migrated away from the user_id columns being dropped.

Removing the Slack and LinkedIn message user_id

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/app/root.tsxno production surface mapped
  • apps/mail/components/ui/active-view-display.tsxno production surface mapped
  • apps/mail/docs/task-ticket-view.mdno production surface mapped
  • apps/mail/lib/quoted-text.tsno production surface mapped
  • apps/mail/lib/utils.tsno production surface mapped
  • apps/mail/modules/calendar/components/LinkifiedEventText.tsxno production surface mapped
  • apps/mail/modules/cedar-os/__tests__/emptyChatLayout.surfaces.test.tsno production surface mapped
  • apps/mail/modules/cedar-os/src/cedar-os-components/chatComponents/emptyChatLayout.tsno production surface mapped
  • apps/mail/modules/cedar-os/src/store/agentConnection/responseProcessors/clientExecutionResponseProcessors.tsno production surface mapped
  • apps/mail/modules/conversations/components/LeftSidebarContent.tsxno production surface mapped
  • apps/mail/modules/conversations/components/ThreadContextCards.tsxno production surface mapped
  • apps/mail/modules/conversations/components/files/DriveSection.tsxno production surface mapped
  • apps/mail/modules/conversations/components/files/drive-types.tsno production surface mapped
  • apps/mail/modules/conversations/components/timeline/NewTaskCreationRow.tsxno production surface mapped
  • apps/mail/modules/conversations/components/timeline/TaskCreatorDialogue.tsxno production surface mapped
  • apps/mail/modules/conversations/components/timeline/UniversalComposer.tsxno production surface mapped
  • apps/mail/modules/conversations/components/timeline/composer/open-slack-draft-in-channel.tsno production surface mapped
  • apps/mail/modules/crm/components/ConversationCellComponents/InlineTaskCreation.tsxno production surface mapped
  • apps/mail/modules/documents/table/CellDisplay.tsxno production surface mapped
  • apps/mail/modules/documents/table/OutputCellEditor.tsxno production surface mapped
  • apps/mail/modules/documents/table/OutputTargetPill.tsxno production surface mapped
  • apps/mail/modules/documents/table/open-output-in-channel.tsno production surface mapped
  • apps/mail/modules/documents/table/starter-table.tsno production surface mapped
  • apps/mail/modules/drafting/components/compose-display.tsxno production surface mapped
  • apps/mail/modules/home/components/AgentHomeHero.tsxno production surface mapped
  • apps/mail/modules/home/components/DisplayArtifactPanel.tsxno production surface mapped
  • apps/mail/modules/home/components/agentHomeActions.tsno production surface mapped
  • apps/mail/modules/home/components/agentic-table.tsno production surface mapped
  • apps/mail/modules/inbox/components/ChannelThreadView.tsxno production surface mapped
  • apps/mail/modules/inbox/store/pending-channel-draft.tsno production surface mapped
  • apps/mail/modules/threads/rendering/archived-thread-guard.tsno production surface mapped
  • apps/mail/modules/threads/rendering/done-thread-resurrection.tsno production surface mapped
  • apps/mail/modules/threads/rendering/use-optimistic-actions.tsno production surface mapped
  • apps/mail/modules/threads/thread/components/draft-composer.tsxno production surface mapped
  • apps/mail/modules/threads/threadList/store/threadSlice.tsno production surface mapped
  • apps/mail/modules/userTasks/CURATED_AGENDA_DESIGN.mdno production surface mapped
  • apps/mail/modules/userTasks/components/NewTaskCard.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskCommandBar.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskExecutionList.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskExecutionUrlSync.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskGroupPills.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskGroupsNav.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskOutputPanel.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskTicketProperties.tsxno production surface mapped
  • apps/mail/modules/userTasks/components/TaskTicketView.tsxno production surface mapped
  • apps/mail/modules/userTasks/hooks/use-create-task-optimistic.tsno production surface mapped
  • apps/mail/modules/userTasks/hooks/use-open-task-in-execution-mode.tsno production surface mapped
  • apps/mail/modules/userTasks/hooks/use-open-task-view.tsno production surface mapped
  • apps/mail/modules/userTasks/slice/userTasksSlice.tsno production surface mapped
  • apps/mail/modules/userTasks/utils/execution-rail.tsno production surface mapped
  • apps/mail/modules/userTasks/utils/open-task.tsno production surface mapped
  • apps/mail/modules/userTasks/utils/task-group-icons.tsno production surface mapped
  • apps/mail/modules/ux/layout/LayoutUrlSync.tsxno production surface mapped
  • apps/mail/providers/query-provider.tsxno production surface mapped
  • apps/mail/tests/lib/labelFlowHarness.tsxno production surface mapped
  • apps/mail/tests/lib/quoted-text.test.tsno production surface mapped
  • apps/mail/tests/lib/utils-reply-body.test.tsno production surface mapped
  • apps/mail/tests/modules/conversations/contextCardsConversation.test.tsno production surface mapped
  • apps/mail/tests/modules/conversations/filesTabDrive.test.tsxno production surface mapped
  • apps/mail/tests/modules/conversations/filesTabHarness.tsxno production surface mapped
  • apps/mail/tests/modules/conversations/threadContextTasksCollapse.test.tsxno production surface mapped
  • apps/mail/tests/modules/documents/table/OutputTargetPill.test.tsxno production surface mapped
  • apps/mail/tests/modules/home/agentHomeHero.test.tsxno production surface mapped
  • apps/mail/tests/modules/home/agenticTable.test.tsno production surface mapped
  • apps/mail/tests/modules/threads/mark-done-flow.test.tsxno production surface mapped
  • apps/mail/tests/modules/userTasks/executionRailHidden.test.tsno production surface mapped
  • apps/mail/tests/modules/userTasks/open-task.test.tsno production surface mapped
  • apps/mail/tests/modules/userTasks/taskTicketProperties.test.tsxno production surface mapped
  • apps/mail/tests/modules/userTasks/taskTicketView.test.tsxno production surface mapped
  • apps/server/.claude/skills/daily-agenda/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/documents/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/documents/agenda-format.mdno production surface mapped
  • apps/server/.claude/skills/playbook-instruction-eval/run-brock-monday.tsno production surface mapped
  • apps/server/.claude/skills/tasks/SKILL.mdno production surface mapped
  • apps/server/docs/bug-agent-draft-quote-and-signature.mdno production surface mapped
  • apps/server/docs/dm-auto-sync.mdno production surface mapped
  • apps/server/docs/google-drive-integration.mdno production surface mapped
  • apps/server/package.jsonno production surface mapped
  • apps/server/src/cli/channels.tsno production surface mapped
  • apps/server/src/db/aop-schema.tsno production surface mapped
  • apps/server/src/db/crm-schema.tsno production surface mapped
  • apps/server/src/db/migrations/add_user_tasks_source_thread.sqlno production surface mapped
  • apps/server/src/db/migrations/drop_message_user_id.sqlno production surface mapped
  • apps/server/src/db/migrations/relax_message_user_id.sqlno production surface mapped
  • apps/server/src/db/migrations/scripts/playbook-health/heal-drifted-code-spans.tsno production surface mapped
  • apps/server/src/db/migrations/scripts/playbook-health/repoint-daily-agenda-cleanup-skill.tsno production surface mapped
  • apps/server/src/db/outbound-ddl.sqlno production surface mapped
  • apps/server/src/db/outbound-schema.tsno production surface mapped
  • apps/server/src/docs/bug-mark-done-threads-reappear.mdno production surface mapped
  • apps/server/src/mastra/agents/automation-agent.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/load-skill-tool.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/scope-map.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/event-execution/handleExecuteScheduledExecution.tsno production surface mapped
  • apps/server/src/mastra/skills/index.tsno production surface mapped
  • apps/server/src/mastra/skills/tasks/daily-agenda.tsno production surface mapped
  • apps/server/src/mastra/skills/tasks/tasks.tsno production surface mapped
  • apps/server/src/mastra/skills/types.tsno production surface mapped
  • apps/server/src/mastra/tools/draft-comms/__tests__/saveDraftTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/draft-comms/saveDraftTool.tsno production surface mapped
  • apps/server/src/mastra/tools/event-execution/onEventExecutionDraftEmailTool.tsno production surface mapped
  • apps/server/src/mastra/tools/meetings/__tests__/findMeetingsTool.visibility.test.tsno production surface mapped
  • apps/server/src/mastra/tools/meetings/__tests__/syncMeetingTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/meetings/__tests__/syncMeetingTool.windowing.test.tsno production surface mapped
  • apps/server/src/mastra/tools/meetings/findMeetingsTool.tsno production surface mapped
  • apps/server/src/mastra/tools/meetings/syncMeetingTool.tsno production surface mapped
  • apps/server/src/mastra/tools/subagent-tool-allowlists.tsno production surface mapped
  • apps/server/src/mastra/tools/task/__tests__/createTaskTool.test.tsno production surface mapped
  • apps/server/src/mastra/tools/task/createTaskTool.tsno production surface mapped
  • apps/server/src/mastra/utils/context-items/hydrate-channels.test.tsno production surface mapped
  • apps/server/src/mastra/utils/context-items/hydrate.tsno production surface mapped
  • apps/server/src/scripts/__tests__/backfill-slack-messages.test.tsno production surface mapped
  • apps/server/src/scripts/backfill-slack-messages.tsno production surface mapped
  • apps/server/src/scripts/channel-sync-live.slack.e2e.test.tsno production surface mapped
  • apps/server/src/scripts/linkedin-live.e2e.test.tsno production surface mapped
  • apps/server/src/scripts/repair-channel-envelopes.tsno production surface mapped
  • apps/server/src/scripts/slack-dm-scan.tsno production surface mapped
  • apps/server/src/scripts/slack-images-probe.tsno production surface mapped
  • apps/server/src/scripts/slack-images.tsno production surface mapped
  • apps/server/src/scripts/verify-channel-containers.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/new-task-agenda-evaluator.test.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/placement-debounce.test.tsno production surface mapped
  • apps/server/src/services/agenda/__tests__/placement.test.tsno production surface mapped
  • apps/server/src/services/agenda/new-task-agenda-evaluator.tsno production surface mapped
  • apps/server/src/services/agenda/tasks-to-agenda.tsno production surface mapped
  • apps/server/src/services/aop/automations.tsno production surface mapped
  • apps/server/src/services/channels/__test__/envelope-db.test.tsno production surface mapped
  • apps/server/src/services/channels/__test__/link-store.test.tsno production surface mapped
  • apps/server/src/services/channels/__test__/linking-create.test.tsno production surface mapped
  • apps/server/src/services/channels/__test__/reconcile.test.tsno production surface mapped
  • apps/server/src/services/channels/envelope.tsno production surface mapped
  • apps/server/src/services/channels/health.tsno production surface mapped
  • apps/server/src/services/channels/history.tsno production surface mapped
  • apps/server/src/services/channels/reconcile.tsno production surface mapped
  • apps/server/src/services/crm/__test__/channel-deal-binding.test.tsno production surface mapped
  • apps/server/src/services/crm/__test__/linkedin-linking.test.tsno production surface mapped
  • apps/server/src/services/crm/__test__/reexecute-slack-source.test.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/slack-events.ingest.test.tsno production surface mapped
  • apps/server/src/services/crm/calendar-events.tsno production surface mapped
  • apps/server/src/services/crm/conversations.tsno production surface mapped
  • apps/server/src/services/crm/slack-events.tsno production surface mapped
  • apps/server/src/services/crm/slack-reactions.tsno production surface mapped
  • apps/server/src/services/crm/suggest-contacts.tsno production surface mapped
  • apps/server/src/services/document-saving/__tests__/markdown-roundtrip.test.tsno production surface mapped
  • apps/server/src/services/document-saving/markdown-parser.tsno production surface mapped
  • apps/server/src/services/document-saving/serialize.tsno production surface mapped
  • apps/server/src/services/documents/table/table-types.tsno production surface mapped
  • apps/server/src/services/drafting/__tests__/gmail-format.test.tsno production surface mapped
  • apps/server/src/services/drafting/__tests__/reply-formatting.test.tsno production surface mapped
  • apps/server/src/services/drafting/drafting.tsno production surface mapped
  • apps/server/src/services/drafting/gmail-format.tsno production surface mapped
  • apps/server/src/services/file-system/index.tsno production surface mapped
  • apps/server/src/services/inbox/__test__/slack-channel-scope.test.tsno production surface mapped
  • apps/server/src/services/inbox/slack-messages.tsno production surface mapped
  • apps/server/src/services/integrations/google/__tests__/drive-grouping.test.tsno production surface mapped
  • apps/server/src/services/integrations/google/__tests__/drive-service.test.tsno production surface mapped
  • apps/server/src/services/integrations/google/drive-folders.tsno production surface mapped
  • apps/server/src/services/integrations/google/drive-grouping.tsno production surface mapped
  • apps/server/src/services/integrations/google/drive-service.tsno production surface mapped
  • apps/server/src/services/integrations/google/types.tsno production surface mapped
  • apps/server/src/services/integrations/linkedin/messaging.tsno production surface mapped
  • apps/server/src/services/integrations/slack/__tests__/slack-attachment-read.test.tsno production surface mapped
  • apps/server/src/services/integrations/slack/__tests__/slack-dm-admit.test.tsno production surface mapped
  • apps/server/src/services/integrations/slack/slack-api.tsno production surface mapped
  • apps/server/src/services/integrations/slack/slack-dm-admit.tsno production surface mapped
  • apps/server/src/services/integrations/slack/slack-events-webhook.tsno production surface mapped
  • apps/server/src/services/notifications/user-slack-notifier.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/seed-playbook.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/daily-agenda.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/channels.tsno production surface mapped
  • apps/server/src/trpc/routes/documents.tsno production surface mapped
  • apps/server/src/trpc/routes/drive.tsno production surface mapped
  • apps/server/src/trpc/routes/files.tsno production surface mapped
  • apps/server/src/trpc/routes/inbox.tsno production surface mapped
  • apps/server/src/trpc/routes/mail.tsno production surface mapped
  • apps/server/src/trpc/routes/task-groups.tsno production surface mapped
  • apps/server/src/trpc/routes/user-tasks.tsno production surface mapped