Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

fix(tasks): remove the 'reminder' task type instead of migrating it in

merged#2822CedarCopilot

CedarCopilot wants to merge 2 commits into staging from fix/remove-reminder-task-type

What Libra verified

  • Reminder is no longer an available task type

    Libra ran this behavior against the change and confirmed the check detects when it breaks.

    Technical evidence
    • the canonical task type definitions and persisted constraint expose only supported values without reminder
    • agent-facing task type guidance and creation input reject reminder while accepting each remaining supported task type

    Changed code: aop-schema.ts.

Live on prod, 0 of 8 surfaces working, less than a day leftTimeline and evidence
  1. Opened
    Sep 18, 2026, 10:41 AM
  2. Sep 18, 2026, 11:47 AM
  3. Merged
    Sep 18, 2026, 12:03 PM
  4. Live on staging
    Sep 18, 2026, 12:03 PM
  5. Live on prod
    Sep 18, 2026, 12:03 PM
  6. Observed 2 days, 8 surfaces, 9 requests
    Sep 18, 2026, 12:03 PM
  7. Pipelines steady after this deploy
    Sep 18, 2026, 12:03 PM
  8. Pipelines steady after this deploy
    Sep 18, 2026, 12:03 PM
  9. Watching

    Live on prod, 0 of 8 surfaces working, less than a day left

    Sep 20, 2026, 12:04 PM

Behaviors Libra is checking

Using the remind-me action creates or updates an email task with task type `follow-up` instead of the removed `reminder` type.Inconclusivelow confidence

Verification reached its 130s outer budget before the verifier returned. Libra is keeping this intent verifying until the next check.

prod, checked Sep 20, 2026, 12:04 PM
Using the mail “remind me” action creates or updates an accepted `follow-up` task while preserving the reminder description, email channel, due date, and task output data.Inconclusivelow confidence

Verification reached its budget before a verdict.

staging, checked Sep 21, 2026, 12:05 AM
A mail reminder only updates its own previously created reminder task, identified by the `source='remind-me'` provenance marker, instead of overwriting an unrelated user-created follow-up on the same conversation and thread.Inconclusivelow confidence

Verification reached its budget before a verdict.

staging, checked Sep 21, 2026, 12:06 AM
The `reminder` task type is no longer accepted, advertised, or permitted by task creation APIs, agent task tooling, admin commands, or the `user_tasks.task_type` database constraint.Inconclusivehigh confidence

Since 2026-09-18T19:03:16Z in staging, telemetry contains only low-volume read/list evidence: userTasks.listUserTasks (3 related spans, HTTP 200, p95 ~724 ms, 1 distinct user) and userTasks.getTaskById (4 related spans, HTTP 200, p95 ~100 ms, 1 distinct user), plus one.

staging, checked Sep 21, 2026, 1:07 AM
Repeated remind-me actions re-find and update only their own thread task, without overwriting an ordinary user-created follow-up on the same conversation and thread.Not checked
prod
The `reminder` task type is no longer exposed or accepted by task APIs, the task tool, the task-admin CLI, or the `user_tasks` database constraint.Not checked
prod

Failures attributed to this change

No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 18, 2026, 2:10 PM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 18, 2026, 2:34 PM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 18, 2026, 4:00 PM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 0 hits · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 18, 2026, 10:35 PM
No prod customers are affected while this is only in staging. If promoted, prod impact is unknown because Libra still needs a concrete exception, route, and failed user action before assigning severity. 1 hit · no retained affected-user count · no retained trace sample.Introducedmedium confidence

internal_only

staging, first seen Sep 19, 2026, 9:48 AM

Libra found 8 production surfaces on prod but could not judge any of them yet. 4 surfaces had under 20 requests, so Libra has not judged them; 4 surfaces had no requests at all. Libra checks hourly for 3 days after each deploy.

Summary

Every create-task call with taskType: 'reminder' has been failing since the feature shipped (2026-05-26): the app-level TASK_TYPES enum allowed it, but the migration adding it to the live user_tasks_task_type_check constraint (0039_add_reminder_task_type.sql) was never applied to prod. Confirmed via prod: zero task_type='reminder' rows have ever existed , both the user-facing "remind me on a thread" feature and agent-created follow-ups (e.g. next-steps) silently lost the task every time, retrying up to 4x against the same deterministic failure and firing a Slack alert each time.

Rather than apply the missing migration, this removes 'reminder' as a task type outright:

  • It has no production data to preserve.
  • The in-flight task-axes migration (apps/mail/modules/userTasks/TASK_AXES_DESIGN.md) already treats 'reminder' as having no long-term home , its own backfill mapping files it under the "Follow-ups" task group, and its divergence notes say it becomes other once task_type is eventually dropped.
  • task_type itself is still live (~111 files still read it; the migration's Phase 8b/9 to drop the column is deferred/gated, stalled since 2026-08-23), so this isn't blocked on that larger migration finishing.

Changes

  • aop-schema.ts , removed 'reminder' from TASK_TYPES, TASK_TYPE_DESCRIPTIONS, and the Drizzle check() definition, which now matches the live prod constraint exactly.
  • mail.ts's upsertReminderTaskForConversation (the one real write path) , now writes taskType: 'follow-up' instead, matching the task-groups migration's own reminder -> Follow-ups mapping. Tightened its lookup predicate with taskCreatedBy: 'user' so it can't collide with agent-created follow-up tasks on the same thread.
  • schemas.ts, taskTool.ts , removed 'reminder' from the agent-facing tool descriptions.
  • user-tasks.ts, task-admin/cli.ts , removed independent 'reminder' enum copies (not derived from the canonical TASK_TYPES).
  • services/user-tasks/tasks.ts , doc comment.
  • mail-remind.test.ts , updated the one test asserting the old (always-failing) behavior.

Left untouched: DailyRecapCategory in recap-helpers.ts/admin.ts and its downstream display-category branches , independently typed, not TaskType-derived, so they don't break; they just become permanently unreachable now that no row can ever have task_type='reminder' again. Optional follow-up cleanup, not part of this PR.

Test plan

  • pnpm --filter @zero/server run types , clean
  • pnpm --filter @zero/server exec vitest run src/trpc/routes/__tests__/mail-remind.test.ts src/mastra/tools/task , 251 passed, 3 pre-existing skips
  • Re-ran the exact insert that was failing in prod (taskType: 'reminder') inside a rolled-back transaction with taskType: 'follow-up' instead , succeeds
  • Confirmed via psql against prod: SELECT count(*) FROM user_tasks WHERE task_type = 'reminder' → 0, so no data migration is needed

🤖 Generated with Claude Code

RetriggerConfidence Score: 4/5

The PR is not safe to merge until Remind Me tasks can be identified without matching and overwriting ordinary user-created follow-ups.

Findings

  1. P1 Reminders overwrite user follow-ups <a href="https://github.com/CedarCopilot/cedar-mail/pull/2822#discussion_r4049
Show production surfaces and changed-file mapping

Production surfaces

SurfaceRequestsErrorsp95UsersVerdict
model_chunk Next Steps and Tasks Manager131 → 50 → 0 (0%)1 ms → 7 ms0Insufficient traffic
5 requests, under the 20 Libra needs
/api/trpc/userTasks.listUserTasks6 → 30 → 0 (0%)6248 ms → 724 ms0Insufficient traffic
3 requests, under the 20 Libra needs
/api/trpc/userTasks.getTaskById0 → 30 → 0 (0%)not measured → 101 ms0Insufficient traffic
3 requests, under the 20 Libra needs
model_step Next Steps and Tasks Manager70 → 20 → 0 (0%)36136 ms → 11832 ms0Insufficient traffic
2 requests, under the 20 Libra needs
POST /api/trpc/userTasks.listUserTasks4 → 20 → 0 (0%)6248 ms → 724 ms0Insufficient traffic
2 requests, under the 20 Libra needs
invoke_agent Next Steps and Tasks Manager36 → 10 → 0 (0%)65219 ms → 22857 ms0Insufficient traffic
1 request, under the 20 Libra needs
execute_tool list-tasks1 → 10 → 0 (0%)292 ms → 59 ms0Insufficient traffic
1 request, under the 20 Libra needs
mail.setRemind0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
mail.setRemind0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/userTasks.listUserTasks0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
POST /api/trpc/userTasks.listUserTasks0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
/api/trpc/userTasks.getTaskById0 → 00 → 0 (0%)not measured0No traffic
No requests recorded since this deploy.
model_chunk Next Steps and Tasks Manager16 → 00 → 0 (0%)1 ms → not measured0No traffic
No requests recorded since this deploy.
model_step Next Steps and Tasks Manager7 → 00 → 0 (0%)18588 ms → not measured0No traffic
No requests recorded since this deploy.
invoke_agent Next Steps and Tasks Manager1 → 00 → 0 (0%)24843 ms → not measured0No traffic
No requests recorded since this deploy.
execute_tool list-tasks1 → 00 → 0 (0%)459 ms → not measured0No traffic
No requests recorded since this deploy.

Changed files → surfaces

  • apps/server/src/services/user-tasks/tasks.tsmodel_chunk Next Steps and Tasks Manager/api/trpc/userTasks.listUserTasks/api/trpc/userTasks.getTaskByIdmodel_step Next Steps and Tasks ManagerPOST /api/trpc/userTasks.listUserTasksinvoke_agent Next Steps and Tasks Manager+8
  • apps/server/.claude/skills/cedar-configuration/fields-and-values.mdno production surface mapped
  • apps/server/src/db/aop-schema.tsno production surface mapped
  • apps/server/src/mastra/tools/task/schemas.tsno production surface mapped
  • apps/server/src/mastra/tools/task/taskTool.tsno production surface mapped
  • apps/server/src/task-admin/cli.tsno production surface mapped
  • apps/server/src/trpc/routes/__tests__/mail-remind.test.tsno production surface mapped
  • apps/server/src/trpc/routes/mail.tsno production surface mapped
  • apps/server/src/trpc/routes/user-tasks.tsno production surface mapped