Skip to content

[Bug]: EmbeddedAttemptSessionTakeoverError: paired lanes on same session race after prompt-lock release #86966

@SteffenStoe

Description

@SteffenStoe

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Two paired internal lanes (a parent lane and a session-scoped lane) operating on the same session .jsonl race after the embedded prompt lock is released, producing EmbeddedAttemptSessionTakeoverError and a failed agent attempt with no reply to the user.

Steps to reproduce

NOT_ENOUGH_INFO

Expected behavior

NOT_ENOUGH_INFO

Actual behavior

Run fails before producing a reply. Two paired lane errors fire within 3–7 ms of each other on the same session file, both with EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released.

Incident A — user-message pathway, version 2026.5.18:

2026-05-26T09:44:16.643+00:00 [diagnostic] lane task error: lane=main durationMs=104790 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: /home/steffen/.openclaw/agents/main/sessions/9fe02f80-14f3-44b1-8fe8-15ab66bedb54.jsonl"
2026-05-26T09:44:16.647+00:00 [diagnostic] lane task error: lane=session:agent:main:main durationMs=104797 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: /home/steffen/.openclaw/agents/main/sessions/9fe02f80-14f3-44b1-8fe8-15ab66bedb54.jsonl"
2026-05-26T09:44:16.662+00:00 Embedded agent failed before reply: session file changed while embedded prompt lock was released: /home/steffen/.openclaw/agents/main/sessions/9fe02f80-14f3-44b1-8fe8-15ab66bedb54.jsonl

Incident B — cron pathway (sessionTarget: isolated, wakeMode: now), version 2026.5.18:

2026-05-26T10:04:59.418+00:00 [diagnostic] lane task error: lane=cron-nested durationMs=42974 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: /home/steffen/.openclaw/agents/main/sessions/ead86ab2-323e-4a83-8770-2219f3eb7d6a.jsonl"
2026-05-26T10:04:59.420+00:00 [diagnostic] lane task error: lane=session:agent:main:cron:97e7b925-6573-47de-8f86-3b5c6ddf1c93:run:ead86ab2-323e-4a83-8770-2219f3eb7d6a durationMs=42976 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: /home/steffen/.openclaw/agents/main/sessions/ead86ab2-323e-4a83-8770-2219f3eb7d6a.jsonl"

User-visible impact:

  • User-message pathway: no Telegram reply delivered.
  • Cron pathway: delivery skipped, consecutiveErrors increments on the affected job.

Versions observed: 2026.5.18. Status on 2026.5.22 is NOT_ENOUGH_INFO (system was updated to 2026.5.22 after the incidents above; no further incident captured in the post-update window of this local journal).

OpenClaw version

2026.5.18 (incidents observed). Also installed and currently running: 2026.5.22 — no incidents captured in post-update window of local journal so far.

Operating system

Ubuntu 24.04.4 LTS (Linux 6.8.0-111-generic, x86_64), Node 22.22.2

Install method

npm global (~/.npm-global/lib/node_modules/openclaw), launched via systemd --user unit openclaw-gateway.service

Model

google/gemini-2.5-pro (thinkingDefault: medium, timeoutSeconds: 300)

Provider / routing chain

openclaw -> google (direct; models.providers is empty, no gateway/proxy in front of provider)

Additional provider/model setup details

  • Single default agent main.
  • Single channel: Telegram (polling mode, one allowed user).
  • 3 active cron jobs, all with sessionTarget: isolated, wakeMode: now, delivery.mode: announce.
  • Incident B above triggered by cron job 97e7b925-... (schedule 0 */4 * * * @Europe/Berlin, staggerMs: 300000), which holds a sessionKey shared with the direct Telegram chat session (agent:main:telegram:default:direct:<userId>).
  • No API keys, tokens, or secret values included here.

Logs, screenshots, and evidence

Lane-error pair pattern (counts from a single 8h window on 2026.5.18, redacted):


1 × lane=main
1 × lane=session:agent:main:main
1 × lane=cron-nested
1 × lane=session:agent:main:cron:<job-uuid>:run:<run-uuid>


Time deltas between paired lane errors on the same session file:
- Incident A: 4 ms (09:44:16.643 → 09:44:16.647)
- Incident B: 2 ms (10:04:59.418 → 10:04:59.420)

Affected job (Incident B) cron config, redacted:

{
  "id": "<job-uuid>",
  "agentId": "main",
  "sessionKey": "agent:main:telegram:default:direct:<user-id>",
  "schedule": { "kind": "cron", "expr": "0 */4 * * *", "tz": "Europe/Berlin", "staggerMs": 300000 },
  "sessionTarget": "isolated",
  "wakeMode": "now",
  "delivery": { "mode": "announce", "to": "telegram:<user-id>", "channel": "telegram", "accountId": "default" }
}


Source: `journalctl --user -u openclaw-gateway`. Session-id and user-id values redacted; original log lines pasted in the Actual behavior field.

Impact and severity

Affected users/systems/channels: single-host OpenClaw installations using a Telegram channel together with one or more cron jobs (sessionTarget: isolated, wakeMode: now). Observed on Ubuntu 24.04 / npm-global install / single agent main.

Severity: User-perceptible silent failure. The lane error is logged but the user receives no Telegram reply, and the cron job records a skipped delivery (consecutiveErrors increments). No data corruption observed; no crash of the gateway process.

Frequency: 2 incidents observed in an 8-hour service window on 2026.5.18 (one user-message pathway, one cron pathway). Broader frequency across the population: NOT_ENOUGH_INFO.

Consequence: missed Telegram replies; cron-scheduled deliveries (e.g., a daily news briefing or an every-4-hour scout job) may silently skip a run.

Additional information

NOT_ENOUGH_INFO

(No last-known-good / first-known-bad version data is available locally — the issue was first noticed and reported from the same install in which it surfaced; no prior-version baseline exists in the local journal.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions