Bug Description
When running openclaw gateway restart via OpenClaw tool call (exec) after upgrading to v2026.3.8, the command fails with "missing tool result" error, and the Gateway does not restart automatically. Manual intervention is required to restart the Gateway.
Important:
- This issue started after upgrading from v2026.3.7 to v2026.3.8
- Running the same command directly in terminal works correctly
- Issue only occurs when executed via tool call/API
Observed Behavior
When executed via OpenClaw tool call:
- Run
openclaw gateway restart via exec tool
- Command returns error:
[openclaw] missing tool result in session history
- Gateway process stops but does not restart
openclaw status shows Gateway as offline
- User must manually restart Gateway (via
openclaw doctor or launchctl)
When executed directly in terminal:
- Run
openclaw gateway restart in terminal
- Command completes successfully
- Gateway restarts automatically
- No error message
Expected Behavior
The gateway restart command should work consistently regardless of execution method:
- Stop the current Gateway process
- Automatically start a new Gateway process
- Return success confirmation after restart completes
Logs
Command output (via tool call):
[openclaw] missing tool result in session history; inserted synthetic error result for transcript repair.
Gateway logs show shutdown but NO automatic restart:
20:55:34.315 [gateway] signal SIGTERM received
20:55:34.316 [gateway] received SIGTERM; shutting down
20:55:34.330 [feishu] feishu[default]: abort signal received, stopping
20:55:34.332 [ws] webchat disconnected code=1012 reason=service restart
# ... 1 minute 34 seconds of SILENCE (Gateway completely offline) ...
# Gateway only started after manual intervention at 20:57:08
20:57:08.724 [gateway] feishu_doc: Registered feishu_doc, feishu_app_scopes
20:57:09.013 [gateway] listening on ws://127.0.0.1:18789
Key observations:
- SIGTERM signal was correctly sent and received
- Gateway shut down gracefully
- LaunchAgent KeepAlive did NOT trigger automatic restart
- Gateway remained offline for 1 minute 34 seconds
- Only restarted after user manually ran
openclaw doctor
Environment
- OpenClaw version: v2026.3.8 (upgraded from v2026.3.7)
- Node.js: v25.8.0
- OS: macOS (Apple Silicon)
- Gateway mode: LaunchAgent (KeepAlive: true)
- LaunchAgent plist:
~/Library/LaunchAgents/ai.openclaw.gateway.plist
- Execution method: OpenClaw
exec tool vs direct terminal
- Issue started: After upgrading to v2026.3.8 on 2026-03-09
Workaround
Manually restart Gateway:
# Option 1: Using launchctl
launchctl bootout gui/$UID/ai.openclaw.gateway
sleep 2
launchctl bootstrap gui/$UID/ai.openclaw.gateway
# Option 2: Direct terminal execution
openclaw gateway restart # Works when run directly in terminal
# Option 3: Reinstall service
openclaw doctor # Reinstalls LaunchAgent service
Additional Context
- Gateway is configured with LaunchAgent KeepAlive=true
- Expected LaunchAgent to automatically restart the process
- Issue only occurs when executed via OpenClaw tool call (exec)
- Direct terminal execution works correctly
- This is a regression in v2026.3.8 - worked correctly in v2026.3.7
- Possible causes:
- exec tool execution environment differs from interactive shell
- Missing environment variables in tool execution context
- LaunchAgent cannot detect process termination from tool-spawned processes
- Signal handling issue when SIGTERM is sent from tool-spawned process
- Gateway exits with code 0 (success) when stopped via tool call, so LaunchAgent doesn't consider it a failure
Bug Description
When running
openclaw gateway restartvia OpenClaw tool call (exec) after upgrading to v2026.3.8, the command fails with "missing tool result" error, and the Gateway does not restart automatically. Manual intervention is required to restart the Gateway.Important:
Observed Behavior
When executed via OpenClaw tool call:
openclaw gateway restartvia exec tool[openclaw] missing tool result in session historyopenclaw statusshows Gateway as offlineopenclaw doctoror launchctl)When executed directly in terminal:
openclaw gateway restartin terminalExpected Behavior
The
gateway restartcommand should work consistently regardless of execution method:Logs
Command output (via tool call):
Gateway logs show shutdown but NO automatic restart:
Key observations:
openclaw doctorEnvironment
~/Library/LaunchAgents/ai.openclaw.gateway.plistexectool vs direct terminalWorkaround
Manually restart Gateway:
Additional Context