openclaw - ✅(Solved) Fix Bug: tools.alsoAllow not injected in Feishu channel sessions (gateway tool unavailable) [1 pull requests, 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#56853Fetched 2026-04-08 01:46:54
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×2

The gateway tool is available in webchat sessions but NOT available in Feishu (飞书) channel sessions, despite tools.alsoAllow: ["gateway"] being configured globally.

Root Cause

When asked to restart gateway, the Feishu agent fell back to exec openclaw gateway restart (which is the old/dangerous method that can cause port conflicts) because the safe gateway(action: "restart") tool was not available.

Fix Action

Fixed

PR fix notes

PR #56917: fix(agents): honor tools.alsoAllow for owner-only tools on external channels

Description (problem / solution / changelog)

fix: #56853

Non-owner sessions (e.g. Feishu and other external channels) strip owner-only tools such as gateway because senderIsOwner is false, while webchat can appear as owner via internal operator scopes. Explicit tools.alsoAllow is intended as user opt-in for those tools but did not bypass owner-only filtering.

  • Add resolveExplicitToolsAlsoAllow (global + per-agent tools.alsoAllow)
  • Extend applyOwnerOnlyToolPolicy with optional alsoAllow to keep opted-in tools
  • Pass explicit alsoAllow from createOpenClawCodingTools and inline skill tool dispatch
  • Tests for merged alsoAllow, gateway exposure when configured, and policy filtering

Tests: pnpm test src/agents/tool-policy.test.ts src/agents/pi-tools.policy.test.ts
src/agents/pi-tools.whatsapp-login-gating.test.ts

Changed files

  • src/agents/pi-tools.policy.test.ts (modified, +16/-0)
  • src/agents/pi-tools.policy.ts (modified, +28/-0)
  • src/agents/pi-tools.ts (modified, +8/-1)
  • src/agents/pi-tools.whatsapp-login-gating.test.ts (modified, +8/-0)
  • src/agents/tool-policy.test.ts (modified, +6/-0)
  • src/agents/tool-policy.ts (modified, +26/-3)
  • src/auto-reply/reply/get-reply-inline-actions.ts (modified, +4/-1)
RAW_BUFFERClick to expand / collapse

Summary

The gateway tool is available in webchat sessions but NOT available in Feishu (飞书) channel sessions, despite tools.alsoAllow: ["gateway"] being configured globally.

Environment

  • OpenClaw version: 2026.3.28 (tested on 2026.3.24 before upgrade, same issue)
  • Channel: Feishu (飞书) via websocket
  • Config: tools.profile: "full", tools.alsoAllow: ["gateway"], gateway.tools.allow: ["gateway"], commands.restart: true
  • Gateway bind: loopback only

Expected Behavior

The gateway tool should be available in all agent sessions (webchat and Feishu) when tools.alsoAllow: ["gateway"] is set globally.

Actual Behavior

  • Webchat sessions: gateway tool is available and working (confirmed gateway(action: "restart") works)
  • Feishu sessions: gateway tool is NOT available in the tool list

The Feishu JARVIS agent explicitly confirmed: "gateway tool is not in my available tools list" and concluded this is a "session-level limitation of OpenClaw, not a configuration issue."

When asked to restart gateway, the Feishu agent fell back to exec openclaw gateway restart (which is the old/dangerous method that can cause port conflicts) because the safe gateway(action: "restart") tool was not available.

Evidence

  1. Webchat agent can successfully call gateway(action: "restart") - confirmed working
  2. Feishu agent sessions (tested: jarvis, zhuge, conan accounts) all lack the gateway tool
  3. Feishu sessions DO see other config changes (model, heartbeat, etc.) - only alsoAllow seems affected
  4. The tools.alsoAllow appears in the webchat session system prompt but not in Feishu session system prompt
  5. Issue persisted across gateway restarts and version upgrades (2026.3.24 to 2026.3.28)

Reproduction Steps

  1. Set tools.alsoAllow: ["gateway"] in openclaw.json
  2. Set gateway.tools.allow: ["gateway"]
  3. Restart gateway
  4. From webchat: call gateway(action: "restart") - works
  5. From Feishu DM: ask the agent to call gateway(action: "restart") - agent reports tool not available

Hypothesis

The tools.alsoAllow configuration may not be propagated to Feishu channel agent sessions during session initialization. This could be:

  • A session-level tool injection issue specific to Feishu channel bindings
  • The alsoAllow may be processed before Feishu bindings are resolved
  • The tool list is generated before the Feishu agent session is fully initialized

Additional Notes

  • commands.restart: true is set and works from webchat
  • gateway.auth.restart field (mentioned in some older docs) does NOT exist in the current config schema
  • This is a security concern because Feishu agents resort to exec openclaw gateway restart which is riskier

extent analysis

Fix Plan

To resolve the issue of the gateway tool not being available in Feishu channel sessions, we need to ensure that the tools.alsoAllow configuration is properly propagated to Feishu channel agent sessions.

Here are the steps to fix the issue:

  • Update the OpenClaw configuration to include a specific allowance for the Feishu channel:
    • Add feishu.tools.alsoAllow: ["gateway"] to the openclaw.json file.
  • Ensure that the Feishu channel bindings are resolved before the tool list is generated:
    • Modify the openclaw.json file to include feishu.channel.initTimeout: 5000 (or a suitable timeout value) to allow sufficient time for the Feishu channel bindings to be resolved.
  • Restart the gateway to apply the changes:
    • Run gateway(action: "restart") from a webchat session or use the exec openclaw gateway restart command (though the latter is less safe and should be avoided when possible).

Example openclaw.json configuration snippet:

{
  "tools": {
    "profile": "full",
    "alsoAllow": ["gateway"]
  },
  "gateway": {
    "tools": {
      "allow": ["gateway"]
    }
  },
  "feishu": {
    "tools": {
      "alsoAllow": ["gateway"]
    },
    "channel": {
      "initTimeout": 5000
    }
  }
}

Verification

To verify that the fix worked, follow these steps:

  • Restart the gateway.
  • From a Feishu DM, ask the agent to call gateway(action: "restart").
  • The agent should now be able to successfully call the gateway tool.

Extra Tips

  • Regularly review the OpenClaw configuration and documentation to ensure that the latest features and best practices are being followed.
  • Consider implementing additional security measures to prevent the use of the exec openclaw gateway restart command, which is less safe than the gateway(action: "restart") tool.

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