openclaw - 💡(How to fix) Fix [Bug] Async command cascade creates unstoppable approval loop

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…
RAW_BUFFERClick to expand / collapse

{ "title": "[Bug] Async command cascade creates unstoppable approval loop — each approval generates delayed completion message, user commands blocked until all fire", "body": "## Description\n\nSeverity: Critical \nReproducibility: Consistent when multiple exec commands are approved in quick succession \nSession: 2026-04-21, 08:39-09:34 GMT+8, webchat channel\n\n---\n\n### Problem Statement\n\nWhen a user approves multiple exec commands in quick succession, each approval generates a separate asynchronous completion message that fires with significant delay. The system fires one completion message per approved command, long after the original task is finished. The user cannot stop the cascade, and any new commands they type are queued behind all the pending completions.\n\nA 10-minute task becomes a 2+ hour session that cannot be ended early.\n\n---\n\n### What Happens\n\n1. User approves 5-10 exec commands in quick succession\n2. Each command executes and completes almost instantly (code 0)\n3. The system queues a separate An async command the user already approved has completed system message for each one\n4. These messages fire one-by-one with 1-3 minute delays between each\n5. For each fired message, the agent produces a full assistant reply\n6. Even if the original task was completed after the first 2-3 completions, the remaining 30-50+ keep firing\n7. User has no way to stop or cancel the pending completions\n8. Any new user commands typed during the cascade are ignored until all pending completions have fired\n9. The session becomes effectively unusable for the duration of the cascade\n\n---\n\n### Real Session Evidence\n\nOn 2026-04-21, between 08:39 and 09:34 GMT+8 (55 minutes):\n\n- 50+ sequential async completion messages fired\n- Each triggered a separate assistant reply\n- The original task (verifying iwencai skill installation) was complete within the first 5 minutes\n- The remaining 50 minutes were the system slowly firing queued completions\n- Commands were simple directory/file checks returning True or directory names\n\n---\n\n### Impact\n\n1. Token/API cost burn: 50+ unnecessary assistant replies in a single session\n2. User experience: Cannot stop the cascade; must wait it out (2+ hours)\n3. Command queue blockage: User new commands are not processed until all pending completions fire\n4. Session hijacked: A simple file verification task consumes the entire session\n\n---\n\n### Expected Behavior\n\n1. When a task is clearly complete, remaining queued async completions should be discarded\n2. User should be able to send a stop command to cancel all pending async completions\n3. Multiple async commands approved for the same logical task should batch their completions into a single system message\n4. New user commands should take priority over pending async completion messages\n\n---\n\n### Environment\n\n- OS: Windows_NT 10.0.26200 (x64)\n- Model: alibailian/qwen3.6-plus\n- Channel: webchat\n- Shell: PowerShell\n- Security mode: ask=on-miss\n\n---\n\n### Suggested Fixes\n\n1. Task conclusion detection: Add a flag when the agent marks a task complete; discard pending async completions\n2. User stop control: Add a /stop command or button to cancel all pending async completions\n3. Batch completions: Batch results for commands approved in the same logical task\n4. Priority queue: New user commands should preempt pending async completion messages\n5. Timeout on stale completions: Discard completions that fire more than N minutes after task completion", "labels": ["bug"] }

extent analysis

TL;DR

Implement a task conclusion detection mechanism to discard pending async completions when a task is marked complete.

Guidance

  • Identify the logical task completion condition and set a flag to indicate task completion, allowing the system to discard pending async completions.
  • Introduce a user-controlled stop command (e.g., /stop) to cancel all pending async completions, providing users with a way to regain control of the session.
  • Consider implementing a priority queue to ensure new user commands are processed before pending async completion messages, preventing command queue blockage.
  • Evaluate the feasibility of batching completions for commands approved in the same logical task, reducing the number of system messages and assistant replies.

Example

# Pseudo-code example of task conclusion detection
if task_completed:
    # Discard pending async completions
    pending_completions.clear()
    # Process new user commands
    process_user_input()

Notes

The suggested fixes require careful consideration of the system's architecture and the definition of a "logical task." The implementation details may vary depending on the specific use case and system requirements.

Recommendation

Apply a workaround by introducing a task conclusion detection mechanism and a user-controlled stop command to mitigate the issue, as upgrading to a fixed version is not mentioned in the issue. This approach allows for a more immediate solution to the problem while more comprehensive fixes are being developed.

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

openclaw - 💡(How to fix) Fix [Bug] Async command cascade creates unstoppable approval loop