openclaw - 💡(How to fix) Fix Agent drops tool execution responses when new user message arrives mid-task [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#75147Fetched 2026-05-01 05:37:45
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
2
Author
Timeline (top)
closed ×1commented ×1mentioned ×1subscribed ×1
RAW_BUFFERClick to expand / collapse

When the agent is executing a long-running tool (e.g. gateway restart) and a new user message arrives before the tool completes, the execution appears to be interrupted and the tool result is never delivered to the user. The agent does not follow up or retry.

Steps to reproduce:

  1. Send a command that triggers a long-running exec (e.g. gateway restart)
  2. Before it completes, send another message
  3. The first command's result is lost with no reply

Environment: OpenClaw 2026.4.27, Linux

This appears to be a task prioritization issue in the agent's execution loop — new messages preempt in-flight tool executions without ensuring the original task completes or the user receives a response.

Suggested fix: The agent loop should not allow new user messages to preempt in-flight tool executions. Either queue the new message until the current tool completes, or ensure the original task's result is always delivered before processing the new message.

extent analysis

TL;DR

The agent's execution loop should be modified to prevent new user messages from interrupting in-flight tool executions, ensuring the original task's result is delivered before processing new messages.

Guidance

  • Identify the current implementation of the agent's execution loop and task prioritization logic to understand how new messages are being handled.
  • Consider implementing a message queue to hold new messages until the current tool execution is complete, preventing preemption.
  • Alternatively, modify the agent to ensure the original task's result is always delivered to the user before processing new messages, potentially by using a callback or promise mechanism.
  • Review the agent's current handling of concurrent executions and message processing to determine the best approach for preventing interruptions.

Example

# Pseudocode example of queuing new messages
message_queue = []

def process_message(message):
    if is_tool_executing():
        message_queue.append(message)
    else:
        execute_tool(message)

def execute_tool(message):
    # Tool execution logic here
    # ...
    # After tool execution completes, process queued messages
    process_queued_messages()

def process_queued_messages():
    while message_queue:
        message = message_queue.pop(0)
        execute_tool(message)

Notes

The suggested fix assumes that the agent's execution loop and task prioritization logic can be modified to accommodate the required changes. The implementation details may vary depending on the specific requirements and constraints of the OpenClaw system.

Recommendation

Apply workaround: Modify the agent's execution loop to prevent new user messages from interrupting in-flight tool executions, using a message queue or ensuring the original task's result is delivered before processing new messages. This approach addresses the identified task prioritization issue and prevents loss of tool execution results.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING