Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[2026-08-25] merging staging to main

merged#2584CedarCopilot

CedarCopilot wants to merge 1 commit into main from staging

Not deployedTimeline and evidence
  1. Opened
    Aug 25, 2026, 9:01 PM
  2. Aug 25, 2026, 9:06 PM
  3. Merged
    Aug 25, 2026, 9:19 PM
  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 update adds the Cedar (fast) chat-runtime choice, consolidated family tools, shared context across chat channels, action-level MCP authorization, and idempotent Slack turn persistence.

One issue remains: the Cedar (fast) family facade for chat context drops fields returned by the underlying operation, so callers cannot consume the full successful result.

The following behaviors were exercised and disproved as defects: Slack normal-turn persistence uses stable IDs and updates delivery metadata without inserting duplicate history; organization viewers selecting Cedar (fast) remain on the protected SDK route with rollout controls both enabled and disabled; and external MCP callers with only docs:read are denied playbook writes, daily-agenda writes, and credential retrieval.

Confidence Score: 4/5

Do not merge until the chat-context family facade preserves the complete delegated operation result for Cedar (fast) users.

The remaining functional failure was reproduced through the production Cedar (fast) routing and family-tool execution path. Focused checks also exercised Slack persistence, viewer routing, and external MCP authorization successfully.

Files Needing Attention: apps/server/src/mastra/tools/chat/chatContextTool.ts needs an output contract that preserves the complete manage-context and resolve-and-attach results.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced a proof for a posted P1 finding and attached test-run artifacts showing the targeted cedar-fast contract test source, routing outcomes, and existing tests passing.
  • The focused Slack turn persistence Vitest suite ran and passed three checks, confirming no duplicate persisted history and correct reaction metadata preservation.
  • Validated Cedar-fast viewer routing across flag configurations; a viewer cannot reach the Mastra family-tool path, with the observed route remaining sdk-harness.
  • Ran an external MCP scope-gate harness and the scope-map regression suite; low-privilege requests are blocked from privileged actions and the regression suite passed 91 tests.
  • T-Rex produced proof for another posted P1 finding; see the corresponding review comment for details.

View all artifacts

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (1)

  1. General comment

    P1 cedar-fast family chat-context invocation truncates successful delegate payload

    • Bug
      • A non-viewer cedar-fast turn routes to Mastra’s family surface and can invoke chat-context(action="manage"), but its successful nested result drops usable delegate fields. The executed repro delegate returned message, echoedInput, and contextWasForwarded; the facade result retained only message.
    • Cause
      • chatContextTool declares its nested output as z.record(z.unknown()) (apps/server/src/mastra/tools/chat/chatContextTool.ts:41-48) and returns a nested result through `deleg
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/atoms/chatAtoms.tsno production surface mapped
  • apps/mail/modules/cedar-os/src/cedar-os-components/chatInput/ReasoningEffortPicker.tsxno production surface mapped
  • apps/mail/modules/cedar-os/src/store/agentConnection/agentConnectionSlice.tsno production surface mapped
  • apps/server/src/lib/logging/perf-timer.tsno production surface mapped
  • apps/server/src/mastra/agents/chat-agent.tsno production surface mapped
  • apps/server/src/mastra/context/values.tsno production surface mapped
  • apps/server/src/mastra/index.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/scope-map.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/scope-map.tsno production surface mapped
  • apps/server/src/mastra/operations/operation-registry.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/imessage/imessage-bot-chat.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/slack/__tests__/slack-turn-persistence.test.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/slack/slack-bot-chat.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/sms/sms-bot-chat.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/contextual-instructions.tsno production surface mapped
  • apps/server/src/mastra/tools/__tests__/family-tool-names.test.tsno production surface mapped
  • apps/server/src/mastra/tools/__tests__/master-surface.test.tsno production surface mapped
  • apps/server/src/mastra/tools/chat/chatContextTool.tsno production surface mapped
  • apps/server/src/mastra/tools/chat/resolveAndAttachTool.tsno production surface mapped
  • apps/server/src/mastra/tools/family-tool-names.tsno production surface mapped
  • apps/server/src/mastra/tools/integrations/externalMcpTool.tsno production surface mapped
  • apps/server/src/mastra/tools/integrations/runCodeExecutorTool.tsno production surface mapped
  • apps/server/src/mastra/tools/master-surface.tsno production surface mapped
  • apps/server/src/mastra/tools/research/researchTool.tsno production surface mapped
  • apps/server/src/mastra/tools/skills/delegateTool.tsno production surface mapped
  • apps/server/src/mastra/tools/skills/loadSkillTool.tsno production surface mapped
  • apps/server/src/mastra/tools/skills/spawnSubagentTool.tsno production surface mapped
  • apps/server/src/mastra/tools/ui-config/uiConfigTool.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/__tests__/surface-context-parity.test.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/chat-org-rules.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/chat-workflow.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/__tests__/routing.test.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/legacy-tool-name-map.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/request-context.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/routing.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/subagents.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/types.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/user-mcp-servers.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/headless-channel-rules.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/preflight-task.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/run-chat-agent-sdk.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/shared-chat-context.tsno production surface mapped
  • apps/server/src/services/playbook/subagents.tsno production surface mapped
  • apps/server/src/services/posthog/posthog.tsno production surface mapped
  • docs/design/cedar-fast-chat-latency-investigation.mdno production surface mapped
  • docs/design/master-agent-tool-families-migration.mdno production surface mapped
  • docs/design/retiring-the-granular-tool-surface.mdno production surface mapped
  • docs/design/unified-chat-surface-workflow.mdno production surface mapped