CedarCopilot wants to merge 3 commits into staging from worktree-send-it-crm-updater-resync
Libra exercised 4 changed behaviors; none regressed.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: orchestrator-dispatch-tools.ts.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: orchestrator-dispatch-tools.ts.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: conversation-context.ts.
Libra ran this behavior against the change and confirmed the check detects when it breaks.
Changed code: orchestrator-dispatch-tools.ts.
Live on prod, watching, 1 day left
Libra has verdicts on 0 of 9 tracked behaviors on prod; 9 are still being checked. Libra checks hourly for 3 days after each deploy.
resyncLinkedDealFromCrm, a timeout-bounded (9s), never-throwing wrapper around the existing pullRefreshCrmDealsForConversations, wired in as a pre-step right before the crm-updater agent starts reasoning about a linked deal , skipped when the subagent is disabled or the event is itself a CRM sync, and falling back to today's behavior (no resync) if the call fails or hangs.fieldsOnly flag so this pre-execution gate only refreshes field values, never the owner-reassignment / active-deal-marking side effects pullRefreshCrmDealsForConversations also performs for its other callers.<current_fields> view (all 8 core metadata fields, not just a subset), so the agent reasons from live data on the same turn, not just the later push-diff. That re-read phase has its own, smaller timeout ceiling (3s) so it can't hang the run either.Full incident writeup and design: docs/design/crm-updater-pre-execution-resync.md.
pnpm --filter @zero/server run types , clean, no errorspnpm deps:check , no dependency violationssrc/services/crm/__tests__/crm-pull-refresh.resync.test.ts , resyncLinkedDealFromCrm's hard no-throw/no-hang contract (real DB failure + genuine hang, not mocked away), and the fieldsOnly guarantee (proves zero owner-directory fetch / reassignment calls under fieldsOnly: true, plus a regression check that omitting it preserves the original behavior for the two pre-existing callers)src/services/crm/__tests__/crm-resync-field-overrides.test.ts , direct coverage of fetchResyncedFieldValues's metadata/custom-field split and null-handling, plus a genuine-hang test proving the new 3s re-read timeout actually bounds the phase (not just typechecks)src/mastra/tools/event-execution/__tests__/crm-updater-enabled-flag.test.ts , end-to-end proof through the real runCrmUpdaterTool.execute call site that a resync failure never affects the run, and that the resync correctly skips when the subagent is disabled or the event is external_crmsrc/mastra/utils/context-formatting/__tests__/extract-conversation-fields-resync-overrides.test.ts , unmocked extractConversationFields, proving all 8 core metadata fields (not just custom fields) correctly reflect a resync overridesrc/services/crm/__tests__/conversation-field-comparison.test.ts , regression check on the shared type guard used to eliminate a cast in both this file and the new oneapps/mail/tests/modules/chat-store/chatHistoryList.test.ts (chat-history date bucketing) , zero files under apps/mail are touched by this diff.Two structured log families to watch in Axiom (cedar-prod dataset) or CloudWatch (/aws/ecs/aws-prod-api/*-service):
crm_pre_execution_resync_complete (info) / crm_pre_execution_resync_failed (warn) , the live-CRM fetch + field-write phase, fields: user_id, conversation_id, org_id, updated_fields (complete) or error (failed, including "timed out after 9000ms" on the 9s ceiling).crm_resync_refetch_timed_out / crm_resync_refetch_failed (warn) , the post-resync re-read phase that feeds the LLM's prompt, same user_id/conversation_id/org_id fields plus error.['cedar-prod']
| where _time > ago(1h) and message in ("crm_pre_execution_r
Libra has not measured any production surfaces for this change yet.