Problem
After #5543, a reactivation that prepends a kept initial brief can still deliver it twice. The reactivation's own send can make its rows durable and then return Err (the same "durable, then Err" shape as U4 path A). taskPrompt then stays, with the launch's taskPromptSendId, which no history row carries. The next reawakening prepends the brief again.
This existed before #5543. formal/task-launch models the reawakening (React) as one atomic step, so it does not cover this.
Direction
Stamp a brief send id on the reactivation send that carries the kept prompt (mint one, store it as taskPromptSendId before the send, pass it as sendIdentities), so the existing lookup (isTaskBriefInHistory) recognizes that row too.
Smaller follow-ups from the #5543 review
applyInterruptedTaskStatus (taskService.ts) clears taskPrompt but leaves taskPromptSendId. The id has no effect without a prompt; clear it for tidiness.
- Add one real-session test (real AgentSession + HistoryService) where a Stop rolls back the launch's brief row, and check that the reawakening then sends the brief once.
Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high
Problem
After #5543, a reactivation that prepends a kept initial brief can still deliver it twice. The reactivation's own send can make its rows durable and then return Err (the same "durable, then Err" shape as U4 path A).
taskPromptthen stays, with the launch'staskPromptSendId, which no history row carries. The next reawakening prepends the brief again.This existed before #5543.
formal/task-launchmodels the reawakening (React) as one atomic step, so it does not cover this.Direction
Stamp a brief send id on the reactivation send that carries the kept prompt (mint one, store it as
taskPromptSendIdbefore the send, pass it assendIdentities), so the existing lookup (isTaskBriefInHistory) recognizes that row too.Smaller follow-ups from the #5543 review
applyInterruptedTaskStatus(taskService.ts) clearstaskPromptbut leavestaskPromptSendId. The id has no effect without a prompt; clear it for tidiness.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high