Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[2026-09-20] merging staging to main

merged#2836CedarCopilot

CedarCopilot wants to merge 1 commit into main from staging

Live on prod, 0 of 8 surfaces working, 2 days leftTimeline and evidence
  1. Opened
    Sep 20, 2026, 7:56 AM
  2. Sep 20, 2026, 8:00 AM
  3. Merged
    Sep 20, 2026, 8:08 AM
  4. Live on prod
    Sep 20, 2026, 8:08 AM
  5. Observed 2 hours, 8 surfaces, 0 requests
    Sep 20, 2026, 8:08 AM
  6. Watching

    Live on prod, 0 of 8 surfaces working, 2 days left

    Sep 20, 2026, 8:08 AM
  7. Pipelines steady after this deploy
    Sep 20, 2026, 8:08 AM

Behaviors Libra is checking

Each underlying LLM call made during an agent execution is appended to that execution's llm_calls record with its Understudy correlation ID, workload, model, and timestamp.Not checked
prod
External MCP clients no longer see or can submit the config-read get-credentials action or its getCredentials parameters, while the capability remains available to Cedar's internal family-tool surfaces.Not checked
prod
External MCP session instructions tell clients to invoke Cedar only when the user's own request actually needs Cedar rather than for merely adjacent requests or because another tool could help.Not checked
prod
Systems-write authorization requires in-app scope for credential changes or MCP connections carrying an authorization header, while URL-only connection creation and settings updates require playbook:write and viewers remain blocked.Not checked
prod
External MCP schemas remove the secret-bearing manage_credential_entry variant and authorizationHeader from manage_mcp_connection while retaining non-secret MCP connection operations.Not checked
prod
On-event execution traffic uses the canonical drafter workload name instead of on-event-execution so it shares reporting with drafter subagent executions.Not checked
prod

Failures attributed to this change

error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 9:30 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 9:30 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 9:45 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:15 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:15 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:25 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:57 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:57 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:57 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 11:57 AM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 1:45 PM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 6:30 PM
error @ GET /<redacted-token>/<id>.jsonIntroducedmedium confidence

unknown

prod, first seen Sep 20, 2026, 7:45 PM

Libra found 8 production surfaces on prod but could not judge any of them yet. 8 surfaces had no requests at all. Libra attributed 13 failures to this change at medium confidence and is still confirming them. Libra checks hourly for 3 days after each deploy.

RetriggerConfidence Score: 4/5

Not safe to merge until the Sol tool-call configuration and repository type-safety requirement are fixed. The correlation-log and rollout-identity concerns are non-blocking.

Findings

  1. P2 Await correlation writes
  2. P2 Keep rollout identity
  3. P2 Avoid unchecked assertions
Fix with agent prompt
### Issue 1
apps/server/src/mastra/utils/prompt-cache-fetch.ts:690
This starts `appendLlmCallLog` and immediately discards its promise, even though that promise owns both the database update and connection cleanup. The caller can finish while the write is still pending, so execution records can be missing LLM correlation IDs when the runtime stops. Make this logging operation awaitable with suppressed failures, or register it as runtime background work.

### Issue 2
apps/server/src/services/crm/stage-classification.ts:100-101
Using the fixed `system` identity makes every stage-classification backfill share one feature-flag evaluation and cache entry. Percentage and targeted OSS rollout rules therefore cannot vary for the actual users being processed, despite the caller already having `userId` and `orgId`. Pass a real rollout identity into `classifyEventStage` and use it for the flag check.

### Issue 3
apps/server/src/mastra/agents/automation-agent.ts:256-260
This change casts the dynamic `Object.fromEntries` result to a complete record without validating that every required key exists. That violates the repository directive against using `as` assertions to silence shape errors. Construct the record with inferred keys or validate and narrow its shape instead. This repository requirement must be satisfied before merging.

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.

Summary

This change adds OSS-model routing and LLM-call correlation logging across agent workflows. It must not merge until Sol-routed tool workflows send the required OpenAI reasoning option and the unchecked record assertion is replaced. The correlation logging and CRM stage-classification rollout identity issues are non-blocking but should be addressed to preserve complete tracing and gradual rollout behavior.

Reviews (1) · Last reviewed commit: "Merge pull request #2835 from CedarCopil..."

Show production surfaces and changed-file mapping

Production surfaces

SurfaceRequestsErrorsp95UsersVerdict
/api/trpc/admin.documents.writeGuarded0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
cron-task-queue.processAopAutomations1 → 00 → 0 (0%)1531 ms → not measured0No traffic
No requests recorded since this deploy.
execute_tool write-document0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
execute_tool read-document0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
execute_tool list-documents0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/documents.lastEditors0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
POST /api/trpc/documents.lastEditors0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/documents.getDoc0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.

Changed files → surfaces

  • apps/server/src/mastra/tools/document/documentTool.ts/api/trpc/admin.documents.writeGuardedexecute_tool write-documentexecute_tool read-documentexecute_tool list-documents/api/trpc/documents.lastEditorsPOST /api/trpc/documents.lastEditors+1
  • apps/server/src/services/aop/automations.tscron-task-queue.processAopAutomations
  • .env.exampleno production surface mapped
  • apps/server/docs/design/reversible-writes-and-approval.mdno production surface mapped
  • apps/server/docs/wiki/document-deletion-lifecycle.mdno production surface mapped
  • apps/server/src/db/aop-schema.tsno production surface mapped
  • apps/server/src/db/migrations/0056_agent_executions_llm_calls.sqlno production surface mapped
  • apps/server/src/db/migrations/meta/_journal.jsonno production surface mapped
  • apps/server/src/env.tsno production surface mapped
  • apps/server/src/mastra/agents/analyzer-agent.tsno production surface mapped
  • apps/server/src/mastra/agents/automation-agent.tsno production surface mapped
  • apps/server/src/mastra/agents/chat-agent.tsno production surface mapped
  • apps/server/src/mastra/agents/on-event-execution-agent.tsno production surface mapped
  • apps/server/src/mastra/agents/on-event-orchestrator-agent.tsno production surface mapped
  • apps/server/src/mastra/agents/sub-agents/orchestrator-agent.tsno production surface mapped
  • apps/server/src/mastra/index.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/external-capability-redaction.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/mutating-actions-are-administrable.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/no-bare-user-id-inputs.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/scope-map.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/server.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/__tests__/tool-inputschema-size.test.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/external-capability-redaction.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/flat-args.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/scope-map.tsno production surface mapped
  • apps/server/src/mastra/mcp/external/server.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/slack-bot-chat.tsno production surface mapped
  • apps/server/src/mastra/routeHandlers/sms/sms-bot-chat.tsno production surface mapped
  • apps/server/src/mastra/tools/document/__tests__/documentTool.delete.integration.test.tsno production surface mapped
  • apps/server/src/mastra/tools/event-execution/__tests__/drafter-executor-prompt.test.tsno production surface mapped
  • apps/server/src/mastra/tools/event-execution/orchestrator-dispatch-tools.tsno production surface mapped
  • apps/server/src/mastra/tools/task/updateNextStepsAndTasksTool.tsno production surface mapped
  • apps/server/src/mastra/utils/__tests__/approval.test.tsno production surface mapped
  • apps/server/src/mastra/utils/__tests__/prompt-cache-fetch.test.tsno production surface mapped
  • apps/server/src/mastra/utils/aop-selection.tsno production surface mapped
  • apps/server/src/mastra/utils/approval-policy.tsno production surface mapped
  • apps/server/src/mastra/utils/company-domain-assignment.tsno production surface mapped
  • apps/server/src/mastra/utils/conversation-field-updates.tsno production surface mapped
  • apps/server/src/mastra/utils/event-summarization.tsno production surface mapped
  • apps/server/src/mastra/utils/execution/execute-analyzer.tsno production surface mapped
  • apps/server/src/mastra/utils/execution/execute-orchestrator.tsno production surface mapped
  • apps/server/src/mastra/utils/prompt-cache-fetch.tsno production surface mapped
  • apps/server/src/mastra/utils/strategist-updates.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/chat-workflow.tsno production surface mapped
  • apps/server/src/mastra/workflows/event-execution/__tests__/jev-action-gate-fallback.test.tsno production surface mapped
  • apps/server/src/mastra/workflows/event-execution/on-event-agent-execution-workflow.tsno production surface mapped
  • apps/server/src/mastra/workflows/event-execution/pre-execution-setup.tsno production surface mapped
  • apps/server/src/services/agent-action-queue/llm-calls.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/automations-service.test.tsno production surface mapped
  • apps/server/src/services/crm/stage-classification.tsno production surface mapped
  • apps/server/src/services/documents/index.tsno production surface mapped
  • apps/server/src/services/llm/__tests__/oss-tasks.test.tsno production surface mapped
  • apps/server/src/services/llm/models.tsno production surface mapped
  • apps/server/src/services/llm/oss-tasks.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/jev-action-gate.test.tsno production surface mapped
  • apps/server/src/services/playbook/jev-action-gate.tsno production surface mapped
  • apps/server/src/services/posthog/__tests__/oss-flags.test.tsno production surface mapped
  • apps/server/src/services/posthog/posthog.tsno production surface mapped
  • aws/lib/runtime-contract.tsno production surface mapped
  • docs/design/mcp-observability-and-plugin.mdno production surface mapped