Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(crm): remove dead per-mapping pushEnabled flag

merged#2721CedarCopilot

CedarCopilot wants to merge 2 commits into staging from fix/crm-field-mapping-pushenabled-dead-code

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 7, 2026, 10:48 AM
  2. Sep 7, 2026, 1:23 PM
  3. Merged
    Sep 7, 2026, 1:36 PM
  4. Live on prod
    Sep 7, 2026, 1:36 PM
  5. Observed 4 hours
    Sep 7, 2026, 1:36 PM
  6. Unobserved

    Live on prod, no production signal yet

    Sep 7, 2026, 1:36 PM
  7. Pipelines steady after this deploy
    Sep 7, 2026, 1:36 PM

Behaviors Libra is checking

CRM field-mapping configuration no longer exposes, accepts, persists, or returns the dead per-mapping `pushEnabled` flag.Not checked
prod

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

Summary

  • pushEnabled was stored per CRM field mapping and echoed back through list-fields/link-mapping, but was never read by the actual push path , update-external-crm-workflow.ts loads and pushes every mapped field unfiltered, regardless of this flag.
  • Traced the full git history: every commit that ever touched it shares one author, and the workflow that decides what actually pushes has never referenced it since its creation commit , this was storage/display for a control that was never wired up, not a regression.
  • Removed it from all 6 touch points: connection-config.ts (write), list-fields.ts + link-mapping.ts (read/echo), and the three MCP tool Zod schemas (config-tool-shared.ts, config-write-tool.ts, applyConfigChangeTool.ts) , including one tool description that flatly misstated behavior ("When true, Cedar will push updates for this field back to the CRM").
  • No behavior change: no frontend UI reads it (checked apps/mail, zero references), it was never part of the formal CrmFieldMappingSchema to begin with, and any stale pushEnabled key already sitting in stored connection metadata is now simply inert.

Test plan

  • pnpm --filter @zero/server run types , clean, zero errors
  • Confirmed zero remaining pushEnabled references in apps/server/src (excluding the unrelated, real externalCrmPushEnabled connection-level switch)
  • Diffed against current staging tip in an isolated worktree to confirm no unrelated drift

šŸ¤– Generated with Claude Code

https://claude.ai/code/session_01KuoDhNC8dK169ShDF4Ysny

Greptile Summary

This PR removes the unused per-field pushEnabled property across CRM mapping configuration, service results, and Mastra tool schemas.

  • Stops accepting or persisting the property when mappings are created or updated.
  • Stops returning it from field-listing and mapping-linking operations.
  • Removes the misleading tool description that suggested the property controlled CRM pushes.
  • The corresponding mapping tests still assert the removed contract and need to be updated.

Confidence Score: 4/5

The implementation appears behaviorally sound, but the PR should not merge until the affected test fixtures and assertions are updated to the new mapping contract.

The removed field is not used by the CRM push path, but several existing tests still pass or expect it and therefore conflict directly with the changed implementation.

Files Needing Attention: apps/server/src/services/integrations/connection-config.ts, apps/server/src/services/aop/link-mapping.ts, apps/server/src/services/aop/list-fields.ts

Important Files Changed

FilenameOverview
apps/server/src/services/integrations/connection-config.tsRemoves pushEnabled from mapping writes, but the existing persistence test still expects it to be stored.
apps/server/src/services/aop/link-mapping.tsRemoves the property from link parameters and results, while an existing call assertion retains the old argument.
apps/server/src/services/aop/list-fields.tsStops exposing the property in mapping summaries, while an existing result assertion still requires it.
apps/server/src/mastra/tools/config/config-write-tool.tsRemoves the obsolete field from link-mapping input, output, proposal, and service invocation shapes.
apps/server/src/mastra/tools/config/config-tool-shared.tsRemoves the obsolete field from the shared mapping output schema.
apps/server/src/mastra/skills/account-config/tools/applyConfigChangeTool.tsRemoves the obsolete field and its inaccurate behavior description from account-config changes.
Prompt To Fix All With AI
### Issue 1
apps/server/src/services/integrations/connection-config.ts:210
**Mapping Tests Keep Old Contract**

Removing `pushEnabled` from the mapping write and serialization paths leave
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/src/mastra/skills/account-config/tools/applyConfigChangeTool.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-tool-shared.tsno production surface mapped
  • apps/server/src/mastra/tools/config/config-write-tool.tsno production surface mapped
  • apps/server/src/services/aop/__tests__/list-fields.test.tsno production surface mapped
  • apps/server/src/services/aop/link-mapping.tsno production surface mapped
  • apps/server/src/services/aop/list-fields.tsno production surface mapped
  • apps/server/src/services/integrations/__tests__/connection-config.test.tsno production surface mapped
  • apps/server/src/services/integrations/connection-config.tsno production surface mapped