Skip to content

Agent hangs after user message - partial output not resumed #50341

Description

@eazyzhang

Problem Description

When a user sends a message that requires the agent to perform tool calls (e.g., write to a file), sometimes the model generates a partial response and stops prematurely. The session then appears "stuck" - no further output is generated, and the agent won't respond until the user sends another message to "wake it up".

Steps to Reproduce

  1. User sends a message that would trigger a tool call (e.g., "save this to file")
  2. Agent starts processing, model generates a partial response (thinking about calling a tool)
  3. Response is truncated/stops unexpectedly (stopReason: "stop" instead of "toolUse")
  4. Agent becomes unresponsive - no further output
  5. User waits indefinitely - no response comes
  6. User sends another message (e.g., "继续" or "好了吗")
  7. Agent "wakes up" and continues processing

Observed Behavior

  • Session shows the agent started responding but stopped mid-generation
  • Timestamps show long gaps (e.g., 20+ minutes) between user message and when they need to re-trigger
  • This happens intermittently, not on every message
  • When re-triggered, the agent resumes normally

Expected Behavior

The system should either:

  1. Detect when the agent stops responding and automatically recover, OR
  2. Have a mechanism to "wake up" a stuck session without user intervention (e.g., heartbeat-style recovery check)

Possible Solutions

  1. Auto-retry on partial output: When model stops with incomplete response, automatically retry or continue
  2. Session health check: Detect "user message sent but no assistant response" state and trigger recovery
  3. Timeout-based recovery: After N seconds of no response, automatically send a recovery prompt to the agent
  4. External monitor: A service that monitors session states and triggers recovery when stuck

Environment

  • OpenClaw version: 2026.3.8
  • Model: gpt-5.4
  • Channel: Telegram
  • Session type: agent:main

Additional Context

This issue has been observed multiple times. The workaround is for the user to send another message, but this is not ideal for automation workflows.

Tagging for visibility: @openclaw/team

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions