openclaw - 💡(How to fix) Fix Feature: user interrupt during streaming / tool execution [1 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#68929Fetched 2026-04-20 12:04:23
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants
RAW_BUFFERClick to expand / collapse

Problem

When the agent is mid-turn (e.g., running a long tool call, streaming results), the user has no way to interrupt or redirect. Messages queue until the full turn completes.

This is particularly problematic for:

  • Search/list tasks: user finds item #1 acceptable and wants to stop the search early
  • Partial thinking: agent narrates what it is about to do ("checking X...") but user cannot correct course
  • Cooperative debugging: user sees agent going down wrong path and wants to intervene early

Desired behavior

At tool-return breakpoints, the agent should check for queued user messages before continuing. If a message is waiting, process it first.

This enables:

  • "ok good enough, stop" interruptions on list/search tasks
  • Mid-stream corrections on agent thinking
  • Cooperative debugging without waiting for full turn completion

Related

Claude Code implements a similar feature where partial results stream to the user and can be accepted/interrupted early.

Technical note

This requires the message queue to be visible to the agent at tool boundaries, not just at turn boundaries. The queue should be pollable cheaply after each tool completes.

extent analysis

TL;DR

Implement a mechanism for the agent to check the message queue at tool-return breakpoints and process any waiting messages before continuing.

Guidance

  • Identify the points in the code where tool calls complete and results are streamed back to the user, as these are the potential breakpoints for checking the message queue.
  • Modify the agent's logic to poll the message queue at these breakpoints, allowing for early interruption or redirection based on user input.
  • Consider implementing a flag or indicator to track whether a user message is waiting in the queue, enabling the agent to prioritize processing this message over continuing its current task.
  • Review the message queue's implementation to ensure it can be polled efficiently and cheaply after each tool completes, as required for this feature.

Example

# Pseudo-code example of checking the message queue at a tool-return breakpoint
def tool_completed():
    # Check if there are any waiting user messages
    if message_queue.has_waiting_messages():
        # Process the waiting message
        process_user_message(message_queue.dequeue())
    else:
        # Continue with the current task
        continue_current_task()

Notes

The exact implementation details may vary depending on the specific architecture and technologies used in the project. Ensuring the message queue is designed for efficient polling is crucial for this feature.

Recommendation

Apply a workaround by modifying the agent's logic to check the message queue at tool-return breakpoints, as this approach aligns with the desired behavior and can be implemented without requiring significant changes to the underlying system.

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