Skip to content

🤖 Task launch: a reactivation that prepends the brief can resend it after a durable-then-Err send #5544

Description

@ThomasK33

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions