Skip to content

[Bug] EmbeddedAttemptSessionTakeoverError causes truncated replies + kimi-k2.6 schema incompatibility after upgrade #83615

@mobai-ink

Description

@mobai-ink

Describe the bug

After upgrading to 2026.5.16-beta.7, conversations on both webchat and telegram channels exhibit the following issues:

  1. Replies are truncated mid-sentence — the embedded agent fails with EmbeddedAttemptSessionTakeoverError before completing its response.
  2. LLM requests fail with 400 on kimi-k2.6 — the provider rejects the new reasoning_details field.
  3. All web_fetch / web_search tool calls are blocked — DNS resolution for public domains is classified as "private/internal IP".

To Reproduce

  1. Upgrade OpenClaw to 2026.5.16-beta.7.
  2. Send a message via telegram or webchat.
  3. Observe: the reply starts normally but gets cut off, followed by an error message.

Expected behavior

  • Replies should complete fully without truncation.
  • reasoning_details field should either be conditionally sent based on provider compatibility, or the provider should accept it.
  • Public domain URL fetches should not be blocked by the security layer.

Actual behavior

Issue 1: EmbeddedAttemptSessionTakeoverError — Truncated Replies

[2026-05-18T12:57:26.922Z] ERROR diagnostic: lane task error: lane=main durationMs=24271 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: <redacted>/agents/main/sessions/9b5ccdf9-f6d6-4455-a01a-255947761778.jsonl"

[2026-05-18T12:57:26.924Z] ERROR diagnostic: lane task error: lane=session:agent:main:telegram:direct:<redacted> durationMs=24274 error="EmbeddedAttemptSessionTakeoverError: session file changed while embedded prompt lock was released: <redacted>/agents/main/sessions/9b5ccdf9-f6d6-4455-a01a-255947761778.jsonl"

[2026-05-18T12:57:26.933Z] ERROR console: Embedded agent failed before reply: session file changed while embedded prompt lock was released: <redacted>/agents/main/sessions/9b5ccdf9-f6d6-4455-a01a-255947761778.jsonl

Timeline of a single conversation:

  • Inbound telegram message received
  • Model snapshot taken (vercel-ai-gateway/deepseek-v4-flash)
  • Partial reply sent via telegram
  • EmbeddedAttemptSessionTakeoverError thrown, agent aborts
  • Error message sent to telegram

Suspected root cause: A concurrency race condition — the session .jsonl file was modified by another process/thread while the embedded agent prompt lock was released, causing the agent to abort before completing its reply.


Issue 2: Model Schema Incompatibility — reasoning_details Rejected by kimi-k2.6

[2026-05-18T07:37:56.508Z] ERROR diagnostic: lane task error: lane=session:agent:main:main durationMs=39527 error="FailoverError: LLM request failed: provider rejected the request schema or tool payload."

[2026-05-18T07:37:56.513Z] WARN model-fallback/decision:
  {
    "reason": "format",
    "status": 400,
    "errorPreview": "400 Error from provider: Extra inputs are not permitted, field: 'messages[2].reasoning_details', value: 'The user greeted me with...'",
    "fallbackStepFinalOutcome": "chain_exhausted"
  }

[2026-05-18T07:38:44.014Z] WARN agent/embedded:
  {
    "isError": true,
    "error": "LLM request failed: provider rejected the request schema or tool payload.",
    "failoverReason": "format",
    "providerRuntimeFailureKind": "schema"
  }

Suspected root cause: After the upgrade, OpenClaw sends a reasoning_details field in the messages array. The opencode-go/kimi-k2.6 provider API does not accept this field and returns 400: Extra inputs are not permitted. Since no fallback model is configured (fallback chain has only 1 candidate), the request fails entirely.


Issue 3: DNS Resolution Blocked by Security Policy

[2026-05-18T07:57:44.289Z] WARN security: blocked URL fetch (url-fetch) targetOrigin=https://httpbin.org reason=Blocked: resolves to private/internal/special-use IP address
[2026-05-18T07:57:44.315Z] WARN security: blocked URL fetch (url-fetch) targetOrigin=https://api.firecrawl.dev reason=Blocked: resolves to private/internal/special-use IP address
[2026-05-18T07:57:51.103Z] WARN security: blocked URL fetch (url-fetch) targetOrigin=https://www.google.com reason=Blocked: resolves to private/internal/special-use IP address
[2026-05-18T07:57:51.113Z] WARN security: blocked URL fetch (url-fetch) targetOrigin=https://www.baidu.com reason=Blocked: resolves to private/internal/special-use IP address

Suspected root cause: DNS resolution for all public domains returns IP addresses that OpenClaw security layer classifies as private/internal/special-use, blocking all outbound URL fetches.

Environment

  • OpenClaw version: 2026.5.16-beta.7 (fff4532)
  • Node.js: v24.15.0
  • OS: Linux
  • Gateway mode: local, loopback bind
  • Primary model: opencode-go/deepseek-v4-pro
  • Channels affected: webchat, telegram

Configuration (relevant sections)

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "opencode-go/deepseek-v4-pro"
      },
      "models": {
        "opencode-go/kimi-k2.6": {},
        "opencode-go/deepseek-v4-pro": {},
        "opencode-go/deepseek-v4-flash": {}
      }
    }
  },
  "gateway": {
    "mode": "local",
    "bind": "loopback"
  },
  "tools": {
    "web": {
      "search": {
        "provider": "firecrawl",
        "enabled": true
      }
    }
  }
}

Additional context

  • Full log file available on request (~2MB, can provide privately)
  • Issue 1 is the most critical — it directly causes user-facing response truncation.
  • The EmbeddedAttemptSessionTakeoverError appears to be a regression introduced in this version, as the same configuration worked before the upgrade.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm 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.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.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: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    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