Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

[2026-09-15] merging staging tom ain

merged#2798CedarCopilot

CedarCopilot wants to merge 1 commit into main from staging

Not deployedTimeline and evidence
  1. Opened
    Sep 15, 2026, 9:49 AM
  2. Sep 15, 2026, 9:54 AM
  3. Merged
    Sep 15, 2026, 10:02 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 change improves CRM synchronization, scheduled playbook execution, agent guidance, diagnostics, and conversation search. One reproduced CRM synchronization failure remains: matching deals only by raw ID can let a non-active deal from another provider overwrite shared conversation fields. The added test also uses prohibited TypeScript assertions, which must be corrected before merging.

Confidence Score: 4/5

Do not merge until CRM synchronization distinguishes provider-scoped deal identities and the repository typing requirement is satisfied.

A reproduced shared-conversation field overwrite remains in the CRM synchronization path. The remaining test typing issue violates an explicit repository requirement.

Files Needing Attention: apps/server/src/services/crm/crm-field-sync.ts and apps/server/src/mastra/skills/account-config/tools/tests/getRecentExecutionsTool.test.ts

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced proof for a posted P1 finding and attached four artifacts documenting the cross-provider collision test, current synchronization behavior, provider-aware control behavior, and validation restoration.
  • T-Rex ran the requested general-contract validation, but its local artifact references were not uploaded.
  • T-Rex produced a second P1 finding proof.
  • Execution evidence was captured for the provider ID collision test, including the exact test file and the command used, and it details the test outcome and related logs.
  • T-Rex performed another general-contract validation, but no local artifact references were uploaded.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
### Issue 1
apps/server/src/services/crm/crm-field-sync.ts:126-127
**Qualify deal identity**

The active-deal guard compares only the raw deal ID. CRM providers can use the same ID, so a non-active deal from one provider can be accepted as the active deal from another provider and overwrite shared conversation fields. Pass the incoming provider into this guard and compare both provider and deal ID.

### Issue 2
apps/server/src/mastra/skills/account-config/tools/__tests__/getRecentExecutionsTool.test.ts:50-53
**Remove type assertions**

This test uses `as any` and a second assertion to force the tool execute signature. That violates the repository directive prohibiting TypeScript assertions used to silence typing, including in tests. Replace this with an inferred or validated typed execution boundary; this repository requirement must be satisfied before merging.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "Merge pull request #2797 from CedarCopil..." | Re-trigger Greptile

Greptile also left 2 inline comments on this PR.

Context 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/server/.claude/skills/documents/SKILL.mdno production surface mapped
  • apps/server/.claude/skills/playbook-instruction-eval/taxonomy-field-routing-eval.tsno production surface mapped
  • apps/server/docs/sharing.mdno production surface mapped
  • apps/server/src/mastra/agents/on-event-orchestrator-agent.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/tools/__tests__/getRecentExecutionsTool.test.tsno production surface mapped
  • apps/server/src/mastra/skills/account-config/tools/getRecentExecutionsTool.tsno production surface mapped
  • apps/server/src/mastra/tools/conversation/fetchConversationTool.tsno production surface mapped
  • apps/server/src/mastra/tools/task/updateNextStepsAndTasksTool.tsno production surface mapped
  • apps/server/src/mastra/utils/conversation-field-updates.tsno production surface mapped
  • apps/server/src/mastra/utils/strategist-updates.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/shared-chat-context.tsno production surface mapped
  • apps/server/src/mastra/workflows/event-execution/on-event-agent-execution-workflow.tsno production surface mapped
  • apps/server/src/services/agents/__tests__/per-user-runs.test.tsno production surface mapped
  • apps/server/src/services/crm/__tests__/crm-field-sync-full.test.tsno production surface mapped
  • apps/server/src/services/crm/crm-field-sync.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/org-cron-eligibility.test.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/org-cron-representative.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/coach-weekly.tsno production surface mapped
  • apps/server/src/services/playbook/manifest-utils.tsno production surface mapped
  • apps/server/src/services/turbopuffer/search.tsno production surface mapped