openclaw - 💡(How to fix) Fix Exec approval requests should pause the agent turn until resolved [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#70953Fetched 2026-04-24 10:37:26
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Error Message

  • Timeout: If the user never responds to the approval, the turn should eventually time out with a clear error rather than hanging indefinitely.
RAW_BUFFERClick to expand / collapse

Problem

When an exec command enters approval-pending state, the agent turn continues executing instead of pausing. This leads to several issues:

  1. Compounding decisions: The agent may proceed with other work based on the assumption that the pending command will succeed, creating cascading logic errors if the command is ultimately denied.
  2. Approval flooding: The agent may issue additional commands while the first is still pending, generating multiple simultaneous approval requests for the user.
  3. Unpredictable state: Subsequent tool calls in the same turn may depend on the output of the blocked command, but have no way to access it.

Current Behavior

An exec call that requires approval returns immediately with a pending status. The agent continues its turn, potentially issuing more commands or making decisions without the result.

Proposed Behavior

When an exec command enters approval-pending state, the agent turn should pause (await) until the user resolves the approval (approve/deny). Subsequent tool calls in the turn would only execute after the approval result is known.

This would:

  • Prevent multiple simultaneous approval requests
  • Ensure the agent has the command result before proceeding
  • Make execution flow deterministic and predictable
  • Align with the principle that a pending approval is a hard stop, not a soft note

Edge Cases to Consider

  • Timeout: If the user never responds to the approval, the turn should eventually time out with a clear error rather than hanging indefinitely.
  • Background mode: If the command was explicitly run in background mode, awaiting may not apply — but foreground/interactive commands should wait by default.

extent analysis

TL;DR

Modify the agent to pause its turn when an exec command enters approval-pending state, awaiting the user's approval before proceeding.

Guidance

  • Introduce a mechanism for the agent to detect when an exec command is in approval-pending state and pause its turn accordingly.
  • Implement a timeout for pending approvals to prevent indefinite hangs, with a clear error message upon timeout.
  • Consider the distinction between foreground/interactive and background modes when deciding whether to pause the agent's turn.
  • Review the current approval handling logic to ensure it aligns with the proposed behavior of treating a pending approval as a hard stop.

Example

def exec_command(command):
    # ... (existing code)
    if command_status == 'approval-pending':
        # Pause the agent's turn and await user approval
        await_approval_result = await get_approval_result(command)
        # Proceed with the turn based on the approval result
        if await_approval_result == 'approved':
            # Continue with the turn
            pass
        elif await_approval_result == 'denied':
            # Handle denied approval
            pass
        else:
            # Handle timeout or other error cases
            pass

Notes

The exact implementation details may vary depending on the specific technology stack and framework used. It's essential to consider edge cases, such as timeouts and background mode, when designing the solution.

Recommendation

Apply a workaround by introducing a pause mechanism for approval-pending states, as this aligns with the proposed behavior and addresses the identified issues.

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