Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

Every agent template arrives with a workspace , and two agent-configuration bugs

merged#2876CedarCopilot

CedarCopilot wants to merge 3 commits into staging from refactor/document-store-retention

Live on prod, 0 of 6 surfaces working, 2 days leftTimeline and evidence
  1. Opened
    Sep 22, 2026, 6:51 AM
  2. Sep 22, 2026, 7:23 AM
  3. Merged
    Sep 22, 2026, 8:30 AM
  4. Live on staging
    Sep 22, 2026, 8:30 AM
  5. Live on prod
    Sep 22, 2026, 8:30 AM
  6. Observed 1 hour, 6 surfaces, 0 requests
    Sep 22, 2026, 8:30 AM
  7. Watching

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

    Sep 22, 2026, 8:30 AM

Behaviors Libra is checking

The agent-library preview shows the complete supplied workspace, opens initially on its output, and renders the seeded bytes for config, memory, and secondary files instead of showing the output example for every file.Not checked
prod
CRM agent administration treats the impersonated/viewed user as the current user, avoiding an unnecessary cross-user target for that user while still targeting a genuinely different teammate.Not checked
prod
The CRM configuration panel uses the viewed user identity rather than the signed-in Cedar staff member when no explicit view-as identity is supplied.Not checked
prod
A CRM updater opened without an explicit tab lands on its CRM Fields tab once that tab is available, while other agents still open on Files and explicit tab links remain authoritative.Not checked
prod
Renaming a document cancels and refreshes the tree, recents, document list, and open-document queries so every file surface shows the new name instead of an old value.Not checked
prod
When saving an onboarding flag fails, the settings cache is refetched so the UI stops claiming that the tour was completed.Not checked
prod

Libra found 6 production surfaces on prod but could not judge any of them yet. 6 surfaces had no requests at all. Libra checks hourly for 3 days after each deploy.

Summary

Every agent template arrives with a workspace. The library offered 24 agents; choosing one minted a definition, a filing, a trigger and a placeholder file that said "I am a placeholder" , no config, no memory, no output template. Measured across the database: config/ existed for 2 users (both hand-made), output tables for 3. jesse's own linkedin-outreach and pipeline-revival folders were empty, and three of his library agents carried a default_file ending in .md, so their Files tab opened on a document that could not exist.

Now a template ships its config, its memory and its output as a skeleton with sample rows, so the only thing left to say in the chat is "fill this out with my data" , plus eighteen new templates distilled from the agents live users actually built (130 custom slugs across ~110 accounts). Design: apps/server/docs/agent-library-workspaces.md.

Alongside it, a set of smaller fixes: onboarding lets you out when you finish or skip it, a subagent read never answers with a tombstone, pipeline review runs without a CRM, a renamed file row carries its new name in the same frame, and a blacklisted query-persistence entry stays un-restored.

Two agent-configuration bugs, both invisible in the way that matters

The CRM updater's fields panel listed the fields it provably never writes. ownerAgentId is a carve-out: resolveFieldLiveness states that crm-updater excludes owned fields, so it writes precisely the fields nobody owns. The panel filtered on ownerAgentId === agentId for every agent alike. On a real account that set is empty , of Kendall's 52 custom fields, 12 belong to her strategist, 40 are unowned, and 0 name crm-updater , so her page showed no CRM fields beside the 40 it rewrites on every run. Anyone auditing "which fields does the CRM updater keep current" from that panel would have concluded none.

The CRM fields tab 403'd in Cedar-staff admin view. Admin view swaps ctx.sessionUser to the impersonated user, but the impersonation middleware skips /auth/*, so useSession() keeps reporting the signed-in staff member , use-viewer-user-id.ts documents this at length, and three call sites ignored it. AgentView passed viewingAs ?? session?.user?.id as the CRM panel's owner, so a request answered as the viewed rep named the staff member as its target and the server refused it. The symptom is a 403 inside one panel with a clean server log, which reads as "this tab is broken" rather than as an auth bug. AgentSettingsSection's CRM fields row was the same class and worse , it passed no targetUserId at all, so an org admin viewing a teammate read their own AOP by that id.

Also here: the CRM updater now lands on its fields tab. Strip order and landing tab are two different questions, so the decision is a pure landingAgentTab() rather than an expression inside a 700-line view , an explicit ?tab= still wins (those addresses are in notifications and chat transcripts already sent), and it waits for the agent rather than guessing, so it can never land on a tab a view-as perspective has hidden.

Verification

Honest scope: this branch carries work from several concurrent sessions. I verified the agent-configuration changes above directly , both fixes are proven against live account data, and carry regression tests (agentFieldsCallout.test.tsx, crm-agent.test.ts → "under Cedar-staff admin view", agent-tabs.test.tslandingAgentTab). 460 tests pass across modules/agents, modules/aop and the home suites; both packages typecheck clean.

The rest of the branch is summarised from its commits and design doc rather than re-verified by me. CI is the first full run over this branch , no /review, /thermo-review or Greptile pass was run for this PR, and oxlint is not installed in this checkout so lint was not run locally.

🤖 Generated with Claude Code

Show production surfaces and changed-file mapping

Production surfaces

SurfaceRequestsErrorsp95UsersVerdict
model_chunk Automation Agent (OSS: meeting-prep)0 → 20 → 0 (0%)not measured → 1 ms0Insufficient traffic
2 requests, under the 20 Libra needs
model_step Automation Agent (OSS: meeting-prep)0 → 10 → 0 (0%)not measured → 7312 ms0Insufficient traffic
1 request, under the 20 Libra needs
model_inference Automation Agent (OSS: meeting-prep)0 → 10 → 0 (0%)not measured → 7311 ms0Insufficient traffic
1 request, under the 20 Libra needs
/api/templates/preview0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
POST /api/templates/preview0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
mail.send.getDraft0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_chunk Automation Agent (OSS: meeting-prep)0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/templates/preview0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_step Automation Agent (OSS: meeting-prep)0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
mail.send.getDraft0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_inference Automation Agent (OSS: meeting-prep)0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
POST /api/templates/preview0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.

Changed files → surfaces

  • apps/server/src/services/agent-library/templates.ts/api/templates/previewPOST /api/templates/preview/api/templates/previewPOST /api/templates/preview
  • apps/server/src/services/agent-library/workspaces/content.tsmail.send.getDraftmail.send.getDraft
  • apps/server/src/services/agent-library/workspaces/meeting-prep.tsmodel_chunk Automation Agent (OSS: meeting-prep)model_step Automation Agent (OSS: meeting-prep)model_inference Automation Agent (OSS: meeting-prep)model_chunk Automation Agent (OSS: meeting-prep)model_step Automation Agent (OSS: meeting-prep)model_inference Automation Agent (OSS: meeting-prep)
  • apps/server/src/services/playbook/agent-defaults/content.tsmail.send.getDraftmail.send.getDraft
  • apps/server/src/services/playbook/agent-defaults/meeting-prep.tsmodel_chunk Automation Agent (OSS: meeting-prep)model_step Automation Agent (OSS: meeting-prep)model_inference Automation Agent (OSS: meeting-prep)model_chunk Automation Agent (OSS: meeting-prep)model_step Automation Agent (OSS: meeting-prep)model_inference Automation Agent (OSS: meeting-prep)
  • apps/mail/lib/query-persistence/index.tsno production surface mapped
  • apps/mail/modules/agents/__tests__/agent-tabs.test.tsno production surface mapped
  • apps/mail/modules/agents/__tests__/crm-agent.test.tsno production surface mapped
  • apps/mail/modules/agents/components/AgentView.tsxno production surface mapped
  • apps/mail/modules/agents/crm-agent.tsno production surface mapped
  • apps/mail/modules/agents/types.tsno production surface mapped
  • apps/mail/modules/files/hooks/use-rename-node.tsno production surface mapped
  • apps/mail/modules/onboarding/hooks/use-onboarding-flags.tsno production surface mapped
  • apps/mail/modules/onboarding/setup/SetupFlow.tsxno production surface mapped
  • apps/mail/modules/onboarding/setup/steps/agent-library/LibraryAgentWorkspace.tsxno production surface mapped
  • apps/mail/tests/lib/query-persistence/restore.test.tsno production surface mapped
  • apps/mail/tests/modules/onboarding/libraryAgentWorkspace.test.tsxno production surface mapped
  • apps/mail/tests/modules/onboarding/onboardingFlags.test.tsxno production surface mapped
  • apps/mail/tests/modules/onboarding/setupFlowKeys.test.tsxno production surface mapped
  • apps/server/docs/agent-library-workspaces.mdno production surface mapped
  • apps/server/docs/wiki/agent-library-workspaces.mdno production surface mapped
  • apps/server/src/agent-library-admin/cli.tsno production surface mapped
  • apps/server/src/mastra/agents/__tests__/agent-chat-shell.test.tsno production surface mapped
  • apps/server/src/mastra/agents/agent-chat-shell.tsno production surface mapped
  • apps/server/src/mastra/workflows/chat/harness/bound-agent.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/personal-lanes.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/provision.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/rules.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/seed-workspace.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/starter.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/templates.test.tsno production surface mapped
  • apps/server/src/services/agent-library/__tests__/workspaces.test.tsno production surface mapped
  • apps/server/src/services/agent-library/personal-lanes.tsno production surface mapped
  • apps/server/src/services/agent-library/provision.tsno production surface mapped
  • apps/server/src/services/agent-library/seed-workspace.tsno production surface mapped
  • apps/server/src/services/agent-library/starter.tsno production surface mapped
  • apps/server/src/services/agent-library/types.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/account-wiki.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/call-refresh.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/coaching.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/competitor-intel.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/contract-chaser.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/crm-updater.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/customer-feedback.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/daily-agenda.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/deal-alerts.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/deal-risk.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/dev-debug.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/drafter.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/event-outreach.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/forecast-roll-up.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/hiring-pipeline.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/inbound-lead-research.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/incumbent-campaigns.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/investor-pipeline.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/lead-scoring.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/linkedin-outreach.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/linkedin-posts.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/lost-deal-debrief.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/meeting-confirmer.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/meeting-recap.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/next-steps.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/objection-library.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/onboarding-plan.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/org-chart.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/org-map.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/outbound-email.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/pipeline-review.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/pipeline-revival.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/proposal-builder.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/reasons-to-reach-out.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/release-feedback.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/revival-call-list.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/shared.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/strategist.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/task-checkin.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/team-coaching.tsno production surface mapped
  • apps/server/src/services/agent-library/workspaces/why-we-win.tsno production surface mapped
  • apps/server/src/services/coaching/__tests__/agent-template.test.tsno production surface mapped
  • apps/server/src/services/coaching/agent-template.tsno production surface mapped
  • apps/server/src/services/documents/convention-paths.tsno production surface mapped
  • apps/server/src/services/playbook/__tests__/read-subagent-full-tombstone.test.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/account-wiki.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/call-refresh.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/competitor-intel.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/contract-chaser.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/crm-updater.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/customer-feedback.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/daily-agenda.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/deal-alerts.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/deal-risk.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/dev-debug.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/drafter.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/event-outreach.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/forecast-roll-up.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/hiring-pipeline.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/inbound-lead-research.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/incumbent-campaigns.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/investor-pipeline.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/lead-scoring.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/linkedin-outreach.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/linkedin-posts.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/lost-deal-debrief.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/meeting-confirmer.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/meeting-recap.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/next-steps.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/objection-library.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/onboarding-plan.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/org-chart.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/org-map.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/outbound-email.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/pipeline-review.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/pipeline-revival.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/proposal-builder.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/reasons-to-reach-out.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/release-feedback.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/revival-call-list.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/strategist.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/task-checkin.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/team-coaching.tsno production surface mapped
  • apps/server/src/services/playbook/agent-defaults/why-we-win.tsno production surface mapped
  • apps/server/src/services/playbook/reference-resolver.tsno production surface mapped
  • apps/server/src/trpc/routes/agent-library.tsno production surface mapped