openclaw - 💡(How to fix) Fix /approve text command deadlocks with plugin approval's blocking waitDecision [2 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#59671Fetched 2026-04-08 02:41:50
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Timeline (top)
commented ×2closed ×1locked ×1

Root Cause

Exec approval works fine with /approve because the agent run completes before the approval decision is needed (non-blocking, expectFinal: false).

RAW_BUFFERClick to expand / collapse

Problem

Exec approval works fine with /approve because the agent run completes before the approval decision is needed (non-blocking, expectFinal: false).

However, plugin approval's waitDecision blocks inside the active agent run (before_tool_call hook). Since the Command Queue serializes per-session runs, a subsequent /approve message from the same session is queued behind the blocked run — causing a deadlock.

Card button callbacks bypass this because they don't go through the inbound message queue.

Repro

  1. Channel session triggers plugin approval → agent run blocks on waitDecision inside before_tool_call
  2. User sends /approve <id> allow-once in the same session
  3. /approve is queued by Command Queue, waiting for the current run to finish
  4. Current run waits for /approvedeadlock

Why exec approval is unaffected

Exec approval is non-blocking: the exec tool returns an approval id immediately, the agent run finishes, the session queue is released, and /approve enters the queue normally.

Why card buttons are unaffected

Card button callbacks (e.g. DingTalk TOPIC_CARD, Discord interactions) take a separate path that does not go through the inbound message queue or per-session serialization.

Impact

Plugin approval can only be resolved via card buttons or from a different session. The /approve text command is unusable for plugin approval within the same session.

Possible solutions

  • Process /approve as a high-priority command that bypasses the per-session queue when a pending approval exists
  • Allow channels to register command interceptors that run before queue serialization
  • Provide a plugin API to resolve pending approvals outside the agent run context

extent analysis

TL;DR

Process /approve as a high-priority command to bypass the per-session queue when a pending approval exists to resolve the deadlock issue.

Guidance

  • Identify and prioritize /approve commands when a pending approval exists to prevent queue blocking.
  • Consider implementing command interceptors that run before queue serialization to handle high-priority commands.
  • Explore providing a plugin API to resolve pending approvals outside the agent run context for more flexibility.
  • Analyze the current queue serialization mechanism to determine if adjustments can be made to accommodate high-priority commands without compromising the integrity of the queue.

Example

No explicit code example is provided due to the complexity and variability of the potential solution, but the concept would involve modifying the command queue handling to prioritize /approve commands when necessary.

Notes

The solution may require significant changes to the command queue and plugin approval mechanisms, and careful consideration should be given to ensure that the changes do not introduce new issues or vulnerabilities.

Recommendation

Apply workaround: Process /approve as a high-priority command to bypass the per-session queue when a pending approval exists, as this approach directly addresses the deadlock issue without requiring a full overhaul of the existing 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

openclaw - 💡(How to fix) Fix /approve text command deadlocks with plugin approval's blocking waitDecision [2 comments, 2 participants]