Libra CodeHub

CedarCopilot/cedar-mail

Branch: staging

test(tasks): pin what a reopened task looks like once its draft is gone

merged#2687CedarCopilot

CedarCopilot wants to merge 0 commits into staging from fix/dm-container-kind

Live on prod, no production signal yetTimeline and evidence
  1. Opened
    Sep 4, 2026, 3:01 PM
  2. Merged
    Sep 4, 2026, 11:43 PM
  3. Live on staging
    Sep 4, 2026, 11:43 PM
  4. Live on prod
    Sep 4, 2026, 11:43 PM
  5. Observed 35 hours
    Sep 4, 2026, 11:43 PM
  6. Unobserved

    Live on prod, no production signal yet

    Sep 4, 2026, 11:43 PM
  7. Pipelines steady after this deploy
    Sep 4, 2026, 11:43 PM
  8. Pipelines steady after this deploy
    Sep 4, 2026, 11:43 PM

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 5, 2026, 7:56 AM

Libra has no production signal for this change on prod yet. Libra checks hourly for 3 days after each deploy.

Follow-up to #2673 (merged as cf0292607), which made ticking a task off delete its Gmail draft.

That change raises a question nothing asserted: reopen a task whose draft was deleted , from the task list's Completed section, or by unticking it on the agenda , and what do you get?

The answer is the intended one, and these pin it:

task state after cleanupright-slot
draft deleted, thread keptExecute , offers to run again
draft deleted, no thread (outbound draft never sent)Execute
draft deleted, but was invoked in chatbot icon , returns to the conversation

deriveAgendaRightSlot already derives this correctly from the stripped taskActionData; the tests exist so a future change to the cleanup shape cannot quietly reintroduce the dangling affordance. The last case asserts through deriveAgendaActionButton that it resolves to { kind: 'execute' } and not a green "Open draft" pill pointing at a draft that no longer exists , the derivation keys off draftId alone, so leaving the pointer behind would have produced exactly that.

The chat-thread case is a deliberate split

Cleanup clears the draft pointer but does not touch chatThreadId. The chat thread is real history that still exists, and the user may want to return to it and ask for a redraft , deleting the draft should not silently delete the conversation that produced it. clearTaskOutput remains the path that forgets an output entirely, nulling both, and its docstring already says the slot then "collapses back to 'invoke'".

So: completion deletes the artifact; clearTaskOutput forgets the whole output.

Test plan

  • pnpm run autofix:local green (exit 0 across oxlint --deny-warnings, deps:check, paraglide, Jest, and 11,106 Vitest tests).
  • Tests only , no production code changes in this PR.

Note on the branch

fix/dm-container-kind was auto-deleted when #2673 merged; pushing this commit recreated it. The branch is exactly one commit ahead of staging. Happy to move it to a fresh branch name if the resurrection is confusing.

🤖 Generated with Claude Code

Greptile Summary

This test-only PR pins the agenda right-slot behavior for reopened tasks after their Gmail draft has been cleaned up:

  • Shows Execute when no draft remains, whether or not an email thread remains.
  • Preserves the bot affordance when chat history remains.
  • Verifies the action button cannot resolve to Open draft without a draftId.

Confidence Score: 5/5

The PR appears safe to merge; it adds focused tests that match the current cleanup contract and agenda derivation behavior.

No actionable defects were found in the changed test coverage, and the cleanup shape is independently asserted by existing server-side tests.

Important Files Changed

FilenameOverview
apps/mail/tests/modules/agentCanvas/agenda-right-slot-state.test.tsAdds focused regression coverage for agenda affordances after task draft cleanup, with no production-code changes.

Reviews (1): Last reviewed commit: "test(tasks): pin what a reopened task lo..." | Re-trigger Greptile

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/mail/tests/modules/agentCanvas/agenda-right-slot-state.test.tsno production surface mapped