Skip to content

cron announce delivery triggers EmbeddedAttemptSessionTakeoverError when user is actively chatting #84583

Description

@jonah791

Problem

When a cron job (sessionTarget="isolated") finishes and its announce delivery sends the result to the same Telegram user, it triggers:

EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released

Root cause

  1. User sends a Telegram message -> session file locked for processing
  2. LLM call is made -> embedded prompt lock temporarily released
  3. Cron job completes -> announce delivery writes to the same Telegram session (delivery.to = same user ID)
  4. Session file changes while the original LLM call is still in flight
  5. LLM returns -> tries to resume -> detects file changed -> takeover error

Relevant config

Cron job delivery:
{
"sessionTarget": "isolated",
"delivery": {
"mode": "announce",
"channel": "telegram",
"to": "8790460537"
}
}

Expected behavior

Cron announce delivery should not modify the active user session file, or should use a separate write path that doesn't conflict with the embedded agent's prompt lock.

Environment

  • OpenClaw 2026.5.18
  • Telegram channel
  • Isolated cron jobs with announce delivery

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions