openclaw - 💡(How to fix) Fix exec approval followup dispatch fails with gateway timeout when user does not respond within approval window [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#60426Fetched 2026-04-08 02:51:21
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
commented ×1

Root Cause

The async followup event may lack proper delivery routing context (e.g., Feishu channel + chat target) when it's triggered as an internal gateway event rather than a user-initiated message turn. The agent produces a response, but the dispatch layer cannot deliver it because:

  • The original WebSocket connection/user context has timed out or been cleaned up
  • The followup dispatch does not inherit the original delivery target (channel, chat_id, etc.)
  • There may be a race condition where the agent's 53ms response arrives after the gateway has already moved on from the followup window

Fix Action

Fix / Workaround

When an exec command requires approval (allowlist mode) and the user does not respond within the approval window (~32min), the subsequent async followup dispatch times out after 60 seconds, failing to deliver the agent's response to the user's chat channel.

00:05:38  [ws] res ✓ agent 53ms runId=exec-approval-followup:06336a4c-e260-41cc-820f-b45167515403
00:06:26  [ws] res ✓ exec.approval.waitDecision 1939120ms
00:06:43  exec approval followup dispatch failed (id=06336a4c-e260-41cc-820f-b45167515403): gateway timeout after 60000ms

Agent responded to the followup in 53ms (00:05:38), but the dispatch was marked failed 60 seconds later (00:06:43) with gateway timeout after 60000ms.

Code Example

00:05:38  [ws] res ✓ agent 53ms runId=exec-approval-followup:06336a4c-e260-41cc-820f-b45167515403
00:06:26  [ws] res ✓ exec.approval.waitDecision 1939120ms
00:06:43  exec approval followup dispatch failed (id=06336a4c-e260-41cc-820f-b45167515403): gateway timeout after 60000ms
RAW_BUFFERClick to expand / collapse

Bug

When an exec command requires approval (allowlist mode) and the user does not respond within the approval window (~32min), the subsequent async followup dispatch times out after 60 seconds, failing to deliver the agent's response to the user's chat channel.

Evidence

From gateway logs (2026-04-04, user session: tide-pine/keen-pine):

00:05:38  [ws] res ✓ agent 53ms runId=exec-approval-followup:06336a4c-e260-41cc-820f-b45167515403
00:06:26  [ws] res ✓ exec.approval.waitDecision 1939120ms
00:06:43  exec approval followup dispatch failed (id=06336a4c-e260-41cc-820f-b45167515403): gateway timeout after 60000ms

Agent responded to the followup in 53ms (00:05:38), but the dispatch was marked failed 60 seconds later (00:06:43) with gateway timeout after 60000ms.

What Happened

  1. User sent a command requiring exec approval → approval prompt shown
  2. User did not approve within the timeout window
  3. Gateway sent exec approval followup to agent ~32 min later
  4. Agent responded in 53ms via WebSocket
  5. But the followup dispatch still failed after 60s timeout

Expected Behavior

When the exec approval times out (user does not respond), the agent's followup response should be properly delivered to the user's chat channel (Feishu, etc.).

Actual Behavior

  • Agent responds to the followup promptly (53ms)
  • But the gateway's dispatch layer marks it as gateway timeout after 60000ms (60s)
  • The agent's message never reaches the user's chat channel
  • From the user's perspective, the agent suddenly goes silent, then later responds out of context

Environment

  • OpenClaw: 2026.4.1 (da64a97)
  • OS: Linux (WSL2, x86_64)
  • Channel: Feishu (IM plugin)
  • exec.host: gateway
  • exec.security: allowlist
  • exec.ask: on-miss

Reproduction

  1. Configure exec with security: allowlist
  2. Execute a command that triggers an approval prompt
  3. Do NOT respond to the approval prompt (let it timeout)
  4. Wait for the followup to trigger (~32min)
  5. Observe: agent responds to the followup but the message is not delivered to the chat channel

Possible Cause

The async followup event may lack proper delivery routing context (e.g., Feishu channel + chat target) when it's triggered as an internal gateway event rather than a user-initiated message turn. The agent produces a response, but the dispatch layer cannot deliver it because:

  • The original WebSocket connection/user context has timed out or been cleaned up
  • The followup dispatch does not inherit the original delivery target (channel, chat_id, etc.)
  • There may be a race condition where the agent's 53ms response arrives after the gateway has already moved on from the followup window

extent analysis

TL;DR

  • Increase the gateway timeout or implement a more robust delivery mechanism to handle async followup dispatches.

Guidance

  • Review the gateway configuration to see if the timeout can be increased or made more dynamic to accommodate slower responses.
  • Investigate the possibility of implementing a message queue or similar mechanism to handle followup dispatches, ensuring they are not lost due to timeouts.
  • Consider modifying the followup dispatch logic to inherit or re-establish the original delivery target context (e.g., Feishu channel, chat_id) to prevent delivery failures.
  • Examine the race condition hypothesis and consider implementing synchronization or buffering to ensure the agent's response is not missed by the gateway.

Example

  • No specific code example can be provided without more context on the gateway and agent implementation, but a potential approach might involve using a message queue like RabbitMQ or Apache Kafka to handle followup dispatches.

Notes

  • The exact solution may depend on the specifics of the gateway, agent, and channel implementations, which are not fully detailed in the issue.
  • Increasing the timeout might not be desirable if it leads to other issues, such as increased resource usage or slower system response times.

Recommendation

  • Apply workaround: Increase the gateway timeout as a temporary measure while a more robust solution is developed, such as implementing a message queue for handling followup dispatches. This is because simply increasing the timeout might not fully address the underlying issues with delivery context and potential race conditions.

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