openclaw - ✅(Solved) Fix Bug: Feishu plugin tools (feishu_doc) not injected into agent tool list in DM sessions (v2026.5.12, fix #49496 claimed in 4.22 but still broken) [1 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#84095Fetched 2026-05-20 03:44:09
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Author
Timeline (top)
labeled ×4cross-referenced ×2commented ×1

Feishu plugin tools (feishu_doc, feishu_drive, etc.) are registered by the plugin (@openclaw/feishu v2026.5.12, enabled) and configured (channels.feishu.tools.doc: true, agent tools.profile: "full"), but the tools never appear in the agent's callable tool list in a Feishu DM session.

The agent consistently responds: "feishu_doc tool is not in my available tools list."

Root Cause

Feishu plugin tools (feishu_doc, feishu_drive, etc.) are registered by the plugin (@openclaw/feishu v2026.5.12, enabled) and configured (channels.feishu.tools.doc: true, agent tools.profile: "full"), but the tools never appear in the agent's callable tool list in a Feishu DM session.

The agent consistently responds: "feishu_doc tool is not in my available tools list."

Fix Action

Fixed

PR fix notes

PR #84133: [codex] Guard published dist against deprecated pi runtime imports

Description (problem / solution / changelog)

Fixes #84095.

Summary

  • Add a postpublish verification guard that rejects root dist artifacts importing deprecated @mariozechner/pi-* runtime packages, even when those package names are still declared in package.json.
  • Add a regression test covering the stale @mariozechner/pi-ai/oauth import pattern.
  • Catch the packaging failure mode behind #84095 before a broken artifact can ship again.

Why

Issue #84095 reported that Feishu DM sessions on OpenClaw 2026.5.12 never exposed feishu_doc, feishu_drive, and related tools, even though the Feishu plugin was enabled and channel tool config was correct.

The failure mode we traced here was stale published root dist output still importing deprecated @mariozechner/pi-* runtime packages such as @mariozechner/pi-ai/oauth. After rebuilding the artifacts so those imports pointed at @earendil-works/pi-ai/oauth, the effective Feishu DM tool inventory included the Feishu document tools again. This patch does not change Feishu runtime behavior directly; it hardens the release guard so that a package containing the stale runtime import pattern is rejected before publish.

Verification

  • pnpm test test/openclaw-npm-postpublish-verify.test.ts
  • pnpm exec oxfmt --check scripts/openclaw-npm-postpublish-verify.ts test/openclaw-npm-postpublish-verify.test.ts
  • git diff --check

Real behavior proof (required for external PRs)

  • Behavior or issue addressed: Prevent shipping an OpenClaw package whose root dist still imports deprecated @mariozechner/pi-* runtime packages. In #84095 this stale packaged runtime import pattern was part of the failure mode that hid Feishu DM tools such as feishu_doc.

  • Real environment tested: Local macOS source checkout with rebuilt dist artifacts and the patched postpublish verifier executed directly via node --import tsx.

  • Exact steps or command run after this patch:

    1. Created a temporary packaged root with package.json declaring @mariozechner/pi-ai and dist/oauth-runtime.js importing @mariozechner/pi-ai/oauth.
    2. Ran collectInstalledRootDependencyManifestErrors(...) from scripts/openclaw-npm-postpublish-verify.ts through node --import tsx --input-type=module.
    3. Ran rg -n "@mariozechner/pi-ai/oauth|@earendil-works/pi-ai/oauth" dist/oauth-*.js and rg -n "@mariozechner/pi-(agent-core|ai|coding-agent|tui)" dist --glob '!dist/extensions/**' || echo 'no deprecated pi root-dist imports found' against the rebuilt local dist.
    4. Ran pnpm test test/openclaw-npm-postpublish-verify.test.ts.
  • Evidence after fix (screenshot, recording, terminal capture, console output, redacted runtime log, linked artifact, or copied live output): Terminal output from the patched verifier against a temp packaged root with the stale runtime import:

    [
      "installed package root dist imports deprecated runtime package '@mariozechner/pi-ai' via: oauth-runtime.js. Rebuild so published artifacts use '@earendil-works/pi-ai'."
    ]

    Terminal output from the rebuilt local dist scan:

    dist import scan:
    dist/oauth-DmXvkUOb.js:21:import { getOAuthApiKey, getOAuthProviders } from "@earendil-works/pi-ai/oauth";
    
    root dist deprecated scan:
    no deprecated pi root-dist imports found

    Terminal output from the focused regression test:

    [test] passed 1 Vitest shard in 2.39s
    
     RUN  v4.1.6 /Users/nianjiu/openclaw
    
    
     Test Files  1 passed (1)
          Tests  23 passed (23)
  • Observed result after fix: The patched verifier now rejects the stale packaged runtime import pattern with an explicit rebuild error, and the rebuilt root dist points at @earendil-works/pi-ai/oauth with no deprecated @mariozechner/pi-* imports left in root dist.

  • What was not tested: I did not rerun a live Feishu DM conversation or a published npm install in this PR update; the real proof here is the patched postpublish verifier behavior plus the rebuilt local dist artifact state.

Changed files

  • scripts/openclaw-npm-postpublish-verify.ts (modified, +28/-4)
  • test/openclaw-npm-postpublish-verify.test.ts (modified, +25/-0)

Code Example

{
  "channels": {
    "feishu": {
      "tools": {
        "perm": true,
        "doc": true,
        "drive": true,
        "chat": true
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Summary

Feishu plugin tools (feishu_doc, feishu_drive, etc.) are registered by the plugin (@openclaw/feishu v2026.5.12, enabled) and configured (channels.feishu.tools.doc: true, agent tools.profile: "full"), but the tools never appear in the agent's callable tool list in a Feishu DM session.

The agent consistently responds: "feishu_doc tool is not in my available tools list."

Environment

  • OpenClaw version: 2026.5.12 (f066dd2)
  • OS: Ubuntu 24.04.3 LTS (KVM VM on Zspace NAS)
  • Node.js: v22.22.2
  • Channel: Feishu DM via WebSocket (account: luban)
  • Agent: luban, tools.profile: "full", deny does NOT include feishu tools
  • Model: deepseek/deepseek-v4-flash
  • Plugin: @openclaw/feishu 2026.5.12 at ~/.openclaw/npm/node_modules/@openclaw/feishu/

Config

{
  "channels": {
    "feishu": {
      "tools": {
        "perm": true,
        "doc": true,
        "drive": true,
        "chat": true
      }
    }
  }
}

Agent luban tool deny list: ["web_fetch", "x_search", "canvas", "tts", "video_generate", "music_generate", "image_generate", "browser"] — feishu tools NOT denied.

What I checked

  1. Plugin loads successfully: openclaw plugins list shows @openclaw/feishu as enabled, source ~/.openclaw/npm/node_modules/@openclaw/feishu/dist/index.js, version 2026.5.12
  2. Tools config is correct: channels.feishu.tools.doc: true, etc.
  3. Agent tool profile is full: luban agent config has tools.profile: "full"
  4. Deny list does not include feishu tools: confirmed
  5. Feishu API works: Using the feishu-api-fallback Python script (direct Feishu Open API call via exec) successfully reads documents — so credentials and permissions are fine
  6. Fix #49496 is in the code: allowGatewaySubagentBinding exists in the compiled JS (openclaw-tools.js:2, server-plugins.js:1) as claimed in the 4.22 fix
  7. Gateway logs show no "Registered feishu_xxx tool" messages after restart — unlike the reporter in #49496 who did see registration messages
  8. Related issues: #49496 (same bug, closed as fixed in 4.22), #39920 (same), #56853 (alsoAllow not injected in Feishu)

Steps to Reproduce

  1. Configure Feishu channel with tools.doc: true
  2. Enable the feishu-doc skill on the agent
  3. Set tools.profile: "full"
  4. Restart gateway
  5. Send a Feishu doc link in DM and ask the agent to read it
  6. Agent responds that the tool is not available

Expected Behavior

The feishu_doc tool (and other Feishu plugin tools) should appear in the agent's callable tool list when processing a Feishu channel DM, just like base tools (exec, read, write, etc.).

Additional Notes

  • The issue might be DM-specific — the original #49496 was reported for group sessions, and the fix might not cover DM code paths
  • Alternatively, the tool registration might not be completing — no "Registered feishu_xxx tool" appears in logs post-restart, suggesting a possible gap between plugin loading and tool registration

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