Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
Title: tools.exec.ask: "always" fails with "pairing required" on local loopback gateway
Summary:
When tools.exec.ask is set to "always" (with security: "full"), all exec commands fail with:
Exec approval registration failed: Error: gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Environment:
- OpenClaw 2026.4.1 (da64a97)
- macOS 15.5 (arm64), Node 25.9.0
- Gateway mode: local, bind: loopback
- Auth mode: token (with valid token set)
Steps to reproduce:
- Set
tools.exec.security: "full" and tools.exec.ask: "always" in openclaw.json
- Set host approvals via
openclaw approvals set with defaults.ask: "always" and defaults.askFallback: "deny"
- Restart gateway
- Agent attempts any exec command (e.g.,
echo hello)
Expected: Approval prompt appears in Control UI; command runs after approval.
Actual: Exec immediately fails with "gateway closed (1008): pairing required" before reaching the approval stage. The approval WebSocket connection to the gateway is rejected.
Workaround: Setting tools.exec.ask: "off" allows exec to function normally. The issue is specific to the approval registration WebSocket, not exec itself.
Diagnostic output:
openclaw gateway probe → Reachable: yes, RPC: ok
openclaw gateway status → Runtime: running, RPC probe: ok
openclaw doctor → no blocking issues
openclaw approvals get → file exists, socket path set, defaults configured
Steps to reproduce
Steps to Reproduce:
- Fresh install OpenClaw 2026.4.1 on macOS via
npm install -g openclaw@latest
- Run
openclaw onboard --install-daemon (local mode, loopback bind, token auth)
- Confirm gateway is running:
openclaw gateway status → Runtime: running, RPC probe: ok
- Set exec approval policy in
~/.openclaw/openclaw.json:
"tools": {
"exec": {
"security": "full",
"ask": "always"
}
}
- Set host-local approvals:
openclaw approvals set --stdin <<'EOF'
{
"version": 1,
"defaults": {
"security": "full",
"ask": "always",
"askFallback": "deny"
}
}
EOF
- Restart gateway:
openclaw gateway restart
- Confirm gateway is healthy:
openclaw gateway probe → Reachable: yes, RPC: ok
- Open Control UI at
http://127.0.0.1:18789
- Send any message that triggers an exec tool call (e.g., "run
echo hello")
- Observe error in agent response:
Exec approval registration failed: Error: gateway closed (1008): pairing required
Gateway target: ws://127.0.0.1:18789
Source: local loopback
- Confirm no approval prompt appears in the Control UI
- Change
ask to "off", restart gateway, retry — exec works normally
Expected behavior
Expected Behavior:
When tools.exec.ask is set to "always", the agent's exec command should be held in a pending state and an approval prompt should appear in the Control UI (or connected companion app), allowing the user to review the command and approve or deny it before execution. After approval, the command should execute normally and return output to the agent.
Actual behavior
Actual Behavior:
The exec command fails immediately without reaching the approval stage. The approval registration WebSocket connection to the gateway is rejected with a 1008: pairing required close code. No approval prompt is shown in the Control UI. The command never executes. This occurs on every exec attempt regardless of the command being run.
OpenClaw version
<v2026.4.1>
Operating system
macOS 15.5
Install method
No response
Model
Claude-Opus-4-6
Provider / routing chain
Agent exec → ask: "always" → approval handler opens WebSocket to ws://127.0.0.1:18789 → gateway rejects with 1008: pairing required → no approval prompt dispatched → command never executes.
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
Title:
tools.exec.ask: "always"fails with "pairing required" on local loopback gatewaySummary:
When
tools.exec.askis set to"always"(withsecurity: "full"), all exec commands fail with:Environment:
Steps to reproduce:
tools.exec.security: "full"andtools.exec.ask: "always"inopenclaw.jsonopenclaw approvals setwithdefaults.ask: "always"anddefaults.askFallback: "deny"echo hello)Expected: Approval prompt appears in Control UI; command runs after approval.
Actual: Exec immediately fails with "gateway closed (1008): pairing required" before reaching the approval stage. The approval WebSocket connection to the gateway is rejected.
Workaround: Setting
tools.exec.ask: "off"allows exec to function normally. The issue is specific to the approval registration WebSocket, not exec itself.Diagnostic output:
openclaw gateway probe→ Reachable: yes, RPC: okopenclaw gateway status→ Runtime: running, RPC probe: okopenclaw doctor→ no blocking issuesopenclaw approvals get→ file exists, socket path set, defaults configuredSteps to reproduce
Steps to Reproduce:
npm install -g openclaw@latestopenclaw onboard --install-daemon(local mode, loopback bind, token auth)openclaw gateway status→ Runtime: running, RPC probe: ok~/.openclaw/openclaw.json:openclaw gateway restartopenclaw gateway probe→ Reachable: yes, RPC: okhttp://127.0.0.1:18789echo hello")askto"off", restart gateway, retry — exec works normallyExpected behavior
Expected Behavior:
When
tools.exec.askis set to"always", the agent's exec command should be held in a pending state and an approval prompt should appear in the Control UI (or connected companion app), allowing the user to review the command and approve or deny it before execution. After approval, the command should execute normally and return output to the agent.Actual behavior
Actual Behavior:
The exec command fails immediately without reaching the approval stage. The approval registration WebSocket connection to the gateway is rejected with a
1008: pairing requiredclose code. No approval prompt is shown in the Control UI. The command never executes. This occurs on every exec attempt regardless of the command being run.OpenClaw version
<v2026.4.1>
Operating system
macOS 15.5
Install method
No response
Model
Claude-Opus-4-6
Provider / routing chain
Agent exec →
ask: "always"→ approval handler opens WebSocket tows://127.0.0.1:18789→ gateway rejects with1008: pairing required→ no approval prompt dispatched → command never executes.Additional provider/model setup details
No response
Logs, screenshots, and evidence
Impact and severity
No response
Additional information
No response