openclaw - ✅(Solved) Fix exec approval system unusable: TUI dialog disappears instantly, all channels blocked [4 pull requests, 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#57460Fetched 2026-04-08 01:49:25
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Timeline (top)
cross-referenced ×4closed ×1commented ×1locked ×1

Error Message

  1. In Telegram: error message "chat exec approvals are not enabled on Telegram"
  • Patch to tools.exec.host: "gateway" → sandbox error fixed

Root Cause

Root Cause Hypothesis

Fix Action

Workaround

Set security: "full" — but this is insecure for production use.

PR fix notes

PR #57516: refactor(exec): centralize native approval delivery

Description (problem / solution / changelog)

Summary

  • add a shared native approval delivery planner in core based on channel-exposed capabilities
  • add plugin-sdk helpers for approval delivery capabilities and planning
  • move Discord and Telegram native approval delivery onto the shared planner instead of channel-local target selection logic
  • keep channel code focused on transport adapters and native target resolution

Issues

Related: #57460 Related: #48532

Testing

  • pnpm test -- src/infra/approval-native-delivery.test.ts src/plugin-sdk/approval-delivery-helpers.test.ts extensions/discord/src/monitor/exec-approvals.test.ts extensions/telegram/src/exec-approvals-handler.test.ts
  • pnpm plugin-sdk:api:check
  • pnpm build

Changed files

  • docs/.generated/plugin-sdk-api-baseline.json (modified, +12/-12)
  • docs/.generated/plugin-sdk-api-baseline.jsonl (modified, +12/-12)
  • extensions/discord/src/approval-native.test.ts (added, +48/-0)
  • extensions/discord/src/approval-native.ts (added, +150/-0)
  • extensions/discord/src/channel.ts (modified, +3/-21)
  • extensions/discord/src/exec-approvals.ts (modified, +19/-4)
  • extensions/discord/src/monitor/exec-approvals.ts (modified, +61/-81)
  • extensions/telegram/src/approval-native.ts (added, +136/-0)
  • extensions/telegram/src/channel.ts (modified, +2/-20)
  • extensions/telegram/src/exec-approvals-handler.test.ts (modified, +50/-0)
  • extensions/telegram/src/exec-approvals-handler.ts (modified, +59/-133)
  • src/channels/plugins/types.adapters.ts (modified, +43/-0)
  • src/infra/approval-native-delivery.test.ts (added, +147/-0)
  • src/infra/approval-native-delivery.ts (added, +134/-0)
  • src/plugin-sdk/approval-delivery-helpers.test.ts (modified, +20/-0)
  • src/plugin-sdk/approval-delivery-helpers.ts (modified, +48/-0)
  • src/plugin-sdk/infra-runtime.ts (modified, +1/-0)

PR #57649: fix(exec): restore channel approval routing

Description (problem / solution / changelog)

Summary

  • wire Discord and Telegram back onto the shared approval runtime for delivery, callback resolution, and typed /approve routing
  • restore Telegram callback resolution, target-recipient approval handling, and channel-native approval button behavior
  • restore Discord plugin approval delivery and resolution on top of the shared runtime

Issues

Fixes #57154 Fixes #57339 Related: #57460

Testing

  • inherited from the stacked validation for this branch family, including:
    • pnpm test -- src/infra/channel-approval-auth.test.ts src/auto-reply/reply/commands.test.ts extensions/telegram/src/exec-approval-resolver.test.ts extensions/telegram/src/bot.test.ts extensions/telegram/src/exec-approvals-handler.test.ts src/infra/exec-approval-channel-runtime.test.ts extensions/discord/src/monitor/exec-approvals.test.ts
    • live gateway smoke: verified exec approval allow/duplicate/expire and plugin approval allow/duplicate against the local gateway on this branch family

Changed files

  • extensions/discord/src/monitor/exec-approvals.test.ts (modified, +114/-362)
  • extensions/discord/src/monitor/exec-approvals.ts (modified, +161/-314)
  • extensions/telegram/src/bot-deps.ts (modified, +5/-0)
  • extensions/telegram/src/bot-handlers.runtime.ts (modified, +122/-80)
  • extensions/telegram/src/bot.create-telegram-bot.test-harness.ts (modified, +9/-0)
  • extensions/telegram/src/bot.test.ts (modified, +215/-0)
  • extensions/telegram/src/button-types.test.ts (added, +85/-0)
  • extensions/telegram/src/channel.ts (modified, +7/-0)
  • extensions/telegram/src/exec-approval-resolver.test.ts (added, +105/-0)
  • extensions/telegram/src/exec-approval-resolver.ts (added, +103/-0)
  • extensions/telegram/src/exec-approvals-handler.test.ts (modified, +4/-3)
  • extensions/telegram/src/exec-approvals-handler.ts (modified, +61/-85)
  • src/auto-reply/reply/commands-approve.ts (modified, +80/-21)
  • src/auto-reply/reply/commands.test.ts (modified, +161/-974)
  • src/infra/channel-approval-auth.test.ts (modified, +3/-3)
  • src/infra/channel-approval-auth.ts (modified, +13/-11)
  • src/infra/exec-approval-channel-runtime.test.ts (modified, +82/-10)
  • src/infra/exec-approval-channel-runtime.ts (modified, +9/-1)

PR #57650: fix(exec): harden approval auth and account routing

Description (problem / solution / changelog)

Summary

  • require explicit channel approval authorization before /approve bypasses normal sender auth
  • scope Telegram plugin approvals to the originating account and tighten native origin-target validation for Telegram and Discord
  • harden the shared approval runtime with payload validation, bounded pending approvals, and safe async error handling
  • stop leaking raw Telegram approval callback errors back into chat

Issues

Related: #57460

Testing

  • pnpm test -- src/infra/channel-approval-auth.test.ts src/auto-reply/reply/commands.test.ts extensions/telegram/src/exec-approval-resolver.test.ts extensions/telegram/src/bot.test.ts extensions/telegram/src/exec-approvals-handler.test.ts src/infra/exec-approval-channel-runtime.test.ts extensions/discord/src/monitor/exec-approvals.test.ts
  • pnpm check
  • pnpm build

Changed files

  • extensions/discord/src/approval-native.ts (modified, +37/-16)
  • extensions/telegram/src/approval-native.ts (modified, +51/-17)
  • extensions/telegram/src/bot-handlers.runtime.ts (modified, +5/-5)
  • extensions/telegram/src/bot.test.ts (modified, +50/-1)
  • extensions/telegram/src/exec-approval-resolver.test.ts (modified, +16/-24)
  • extensions/telegram/src/exec-approval-resolver.ts (modified, +5/-21)
  • extensions/telegram/src/exec-approvals-handler.test.ts (modified, +34/-0)
  • extensions/telegram/src/exec-approvals-handler.ts (modified, +58/-1)
  • src/auto-reply/reply/commands-approve.ts (modified, +3/-1)
  • src/auto-reply/reply/commands.test.ts (modified, +17/-38)
  • src/infra/channel-approval-auth.ts (modified, +14/-4)

PR #57655: fix(exec): add shared approval runtime

Description (problem / solution / changelog)

Summary

  • add a shared core runtime for exec and plugin approval subscriptions, pending tracking, timeout handling, and gateway request plumbing
  • move shared approval reply/action building into core and export the runtime surface through the plugin SDK
  • regenerate the plugin-sdk API baselines for the new shared approval runtime surface

Issues

Related: #57154 Related: #57339 Related: #57460

Testing

  • pnpm test -- src/infra/exec-approval-channel-runtime.test.ts src/infra/exec-approval-reply.test.ts
  • pnpm plugin-sdk:api:check
  • pnpm build

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/.generated/plugin-sdk-api-baseline.json (modified, +585/-153)
  • docs/.generated/plugin-sdk-api-baseline.jsonl (modified, +176/-128)
  • src/infra/exec-approval-channel-runtime.test.ts (added, +439/-0)
  • src/infra/exec-approval-channel-runtime.ts (added, +285/-0)
  • src/infra/exec-approval-reply.test.ts (modified, +75/-0)
  • src/infra/exec-approval-reply.ts (modified, +80/-15)
  • src/plugin-sdk/infra-runtime.ts (modified, +1/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

After upgrading from 3.14 to 3.29 (running main branch at commit 7169362), exec is completely unusable due to broken approval UX.

Steps to Reproduce

  1. Any exec command triggers approval prompt
  2. In terminal UI (tty): approval dialog appears for ~0.1s then disappears — cannot click/select/respond (default action appears to be deny)
  3. In Control UI chat: approval message is delivered but no interactive button is shown
  4. In Telegram: error message "chat exec approvals are not enabled on Telegram"
  5. No way to approve → exec permanently blocked for all channels

Environment

  • OpenClaw: 3.29 (main branch, commit 716936262340c0f2029fda476d8e554955ba9fb7)
  • Config version: 3.14
  • Gateway: local mode
  • Channels: Telegram, Feishu, WeChat plugin (openclaw-weixin)

Investigation Notes

  • tools.exec.host defaults to "sandbox" but sandbox runtime unavailable → exec fails with "sandbox runtime unavailable"
  • Patch to tools.exec.host: "gateway" → sandbox error fixed
  • But tools.exec.security defaults to "deny" (not shown in config, hardcoded default)
  • "deny" mode completely blocks exec
  • Changed to "allowlist" mode → approval required for each exec
  • TUI approval dialog is broken (flashes and disappears) → cannot approve
  • Changed to "full" mode as workaround → exec works but security completely disabled

Root Cause Hypothesis

  1. TUI approval dialog has a race condition — it auto-closes before user can respond
  2. No channel (Telegram, Control UI chat, Feishu) can approve exec requests via chat
  3. No persistent approval policy mechanism that survives gateway restarts

Expected Behavior

  • User should be able to approve exec from TUI reliably
  • OR: tools.exec.security "allowlist" should support persistent source allowlisting (not just per-session approval)
  • OR: gateway should have a CLI command to set permanent exec policy

Workaround

Set security: "full" — but this is insecure for production use.

extent analysis

Fix Plan

To address the issues with the exec approval UX, we will implement the following steps:

  • Update the tools.exec.security mode to "allowlist" and introduce a persistent approval policy mechanism.
  • Fix the TUI approval dialog race condition.
  • Add support for approving exec requests via chat in all channels.

Code Changes

# Update tools.exec.security mode to "allowlist"
config = {
    "tools": {
        "exec": {
            "security": "allowlist"
        }
    }
}

# Introduce a persistent approval policy mechanism
class ApprovalPolicy:
    def __init__(self):
        self.allowed_sources = set()

    def add_allowed_source(self, source):
        self.allowed_sources.add(source)

    def is_allowed(self, source):
        return source in self.allowed_sources

approval_policy = ApprovalPolicy()

# Fix TUI approval dialog race condition
import threading
import time

def show_approval_dialog():
    # Show approval dialog
    print("Approval dialog shown")

    # Wait for user response
    response = input("Enter response: ")

    # Process response
    if response == "allow":
        approval_policy.add_allowed_source("user")
        print("Exec approved")
    else:
        print("Exec denied")

# Add support for approving exec requests via chat
def approve_exec_via_chat(channel, source):
    if channel == "Telegram":
        # Send approval message via Telegram
        print("Approval message sent via Telegram")
    elif channel == "Control UI chat":
        # Send approval message via Control UI chat
        print("Approval message sent via Control UI chat")
    elif channel == "Feishu":
        # Send approval message via Feishu
        print("Approval message sent via Feishu")

    # Add source to allowed sources
    approval_policy.add_allowed_source(source)

# Example usage
approve_exec_via_chat("Telegram", "user")
show_approval_dialog()

Verification

To verify that the fix worked, follow these steps:

  1. Set tools.exec.security mode to "allowlist".
  2. Run an exec command and verify that the approval dialog is shown and can be responded to.
  3. Verify that the approval policy is persisted across gateway restarts.
  4. Test approving exec requests via chat in all channels.

Extra Tips

  • Make sure to update the tools.exec.host to "gateway" to fix the sandbox error.
  • Consider adding a CLI command to set permanent exec policy for easier management.
  • Review the security implications of using the "allowlist" mode and consider implementing additional security measures.

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 - ✅(Solved) Fix exec approval system unusable: TUI dialog disappears instantly, all channels blocked [4 pull requests, 1 comments, 2 participants]