openclaw - 💡(How to fix) Fix [Bug]: exec-approvals socket not created on gateway restart when Telegram delivery fails (message too long) [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#61453Fetched 2026-04-08 02:58:24
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

The exec-approvals server fails to start (no socket created) after a gateway restart when there is a pending approval that previously failed to deliver via Telegram (message too long).

Error Message

{"subsystem":"gateway/exec-approvals","1":"exec approvals: failed to deliver to telegram:telegram:8538179299: GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message is too long)"}

Root Cause

The exec-approvals server fails to start (no socket created) after a gateway restart when there is a pending approval that previously failed to deliver via Telegram (message too long).

Fix Action

Workaround

# Disable exec approvals to clear the retry queue
python3 -c "
import json
with open('~/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
cfg['approvals']['exec']['enabled'] = False
with open('~/.openclaw/openclaw.json', 'w') as f:
    json.dump(cfg, f, indent=2)
"
openclaw gateway restart
# Re-enable after socket is confirmed present

Code Example

{"subsystem":"gateway/exec-approvals","1":"exec approvals: failed to deliver to telegram:telegram:8538179299: GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message is too long)"}

---

# Disable exec approvals to clear the retry queue
python3 -c "
import json
with open('~/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
cfg['approvals']['exec']['enabled'] = False
with open('~/.openclaw/openclaw.json', 'w') as f:
    json.dump(cfg, f, indent=2)
"
openclaw gateway restart
# Re-enable after socket is confirmed present
RAW_BUFFERClick to expand / collapse

Bug: exec-approvals socket not created on gateway restart when Telegram delivery fails

OpenClaw version: 2026.4.2 (d74a122) OS: macOS 15, Apple Silicon M4 Date: 2026-04-05

Summary

The exec-approvals server fails to start (no socket created) after a gateway restart when there is a pending approval that previously failed to deliver via Telegram (message too long).

Steps to Reproduce

  1. Configure approvals.exec in openclaw.json with mode: "session" and a Telegram delivery target
  2. Trigger an exec command that generates a very long approval message (>4096 chars)
  3. The Telegram delivery fails: GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message is too long)
  4. Restart the gateway
  5. Observe: ~/.openclaw/exec-approvals.sock is never created

Expected Behavior

  • Gateway restarts cleanly
  • exec-approvals socket is created on startup
  • Failed delivery from previous session does not affect new startup

Actual Behavior

  • exec-approvals server enters a retry loop on startup trying to re-deliver the failed message
  • Socket is never created
  • All exec calls SIGTERM immediately
  • Loop persists across restarts until approvals.exec.enabled is set to false

Log Evidence

{"subsystem":"gateway/exec-approvals","1":"exec approvals: failed to deliver to telegram:telegram:8538179299: GrammyError: Call to 'sendMessage' failed! (400: Bad Request: message is too long)"}

This error repeated at 11:43, 11:45, 11:48 — retrying every ~2-3 minutes, preventing socket initialization.

Workaround

# Disable exec approvals to clear the retry queue
python3 -c "
import json
with open('~/.openclaw/openclaw.json') as f:
    cfg = json.load(f)
cfg['approvals']['exec']['enabled'] = False
with open('~/.openclaw/openclaw.json', 'w') as f:
    json.dump(cfg, f, indent=2)
"
openclaw gateway restart
# Re-enable after socket is confirmed present

Suggested Fix

In the exec-approvals server startup sequence:

  1. Do not retry failed deliveries from previous sessions on startup
  2. If delivery fails, log the error and mark the approval as expired/failed — do not block initialization
  3. Consider truncating long approval messages to fit Telegram's 4096 char limit

Additional Notes

  • The issue is exacerbated by having agents with ask=off in approvals.agentFilter — these agents don't need the approval UI but their commands still trigger the delivery loop
  • The exec-approvals rulebook (exec-approvals.json) is unaffected and continues working correctly
  • Disabling approvals.exec does NOT disable exec security (the rulebook always applies)

extent analysis

TL;DR

Disable exec approvals temporarily to clear the retry queue, then restart the gateway and re-enable approvals to resolve the socket creation issue.

Guidance

  • Identify and address the root cause of the failed Telegram delivery, such as truncating long approval messages to fit within the 4096 character limit.
  • Modify the exec-approvals server startup sequence to not retry failed deliveries from previous sessions, allowing the socket to be created.
  • Consider logging the error and marking the approval as expired/failed if delivery fails, rather than blocking initialization.
  • Review approvals.agentFilter settings to ensure agents with ask=off are not triggering unnecessary delivery attempts.

Example

No code snippet is provided as the suggested fix involves modifying the exec-approvals server startup sequence, which is not explicitly defined in the issue.

Notes

The provided workaround is a temporary solution to clear the retry queue, but a permanent fix requires modifying the exec-approvals server behavior to handle failed deliveries and long approval messages.

Recommendation

Apply the workaround to temporarily disable exec approvals, restart the gateway, and then re-enable approvals, as this allows the socket to be created and exec calls to function normally. This workaround should be used until a permanent fix is implemented to modify the exec-approvals server behavior.

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]: exec-approvals socket not created on gateway restart when Telegram delivery fails (message too long) [1 participants]