openclaw - ✅(Solved) Fix [BUG] openclaw-lark plugin: contracts.tools not propagated through createCapabilityPluginRecord [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#77982Fetched 2026-05-06 06:18:18
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1

Error Message

The openclaw-lark plugin declares tool contracts via contracts: { tools: [...] } in its export, but all 27+ tools fail registration with the error: This error fires 41 times per plugin load (once per tool registration). Error floods logs: 41 diagnostics per plugin load

Root Cause

Traced through the OpenClaw source:

  1. createCapabilityPluginRecord in bundled-capability-runtime-CQy4xWvL.js (line ~259) does NOT include contracts in the returned object:
function createCapabilityPluginRecord(params) {
    return {
        id: params.id,
        name: params.name ?? params.id,
        // ... all other fields ...
        // ❌ NO `contracts` field
    };
}


2.Later, at line ~513, the bundled runtime calls:
const declaredToolNames = normalizePluginToolContractNames(record.contracts);
record.contracts is undefined → declaredToolNames is empty → every tool fails findUndeclaredPluginToolNames check.

3.Compare with createPluginRecord in loader-DmHfdX8U.js (line ~392), which correctly passes contracts: params.contracts:

function createPluginRecord(params) {
    return {
        // ...
        contracts: params.contracts  // ✅ present here
    };
}

4.But manifestRecord.contracts is never read from the plugin module export by the bundled runtime. The plugin's contracts field in its export is lost at the loadBundledCapabilityRuntimeRegistry level.
Plugin Code (verified correct)
// D:\AI\Openclaw\.openclaw\extensions\openclaw-lark\index.js

const _TOOL_CONTRACTS = [
    "feishu_bitable_app",
    "feishu_bitable_app_table",
    "feishu_bitable_app_table_field",
    "feishu_bitable_app_table_record",
    "feishu_bitable_app_table_view",
    "feishu_calendar_calendar",
    "feishu_calendar_event",
    "feishu_calendar_event_attendee",
    "feishu_calendar_freebusy",
    "feishu_chat",
    "feishu_chat_members",
    "feishu_doc_comments",
    "feishu_doc_media",
    "feishu_drive_file",
    "feishu_im_user_fetch_resource",
    "feishu_im_user_get_messages",
    "feishu_im_user_get_thread_messages",
    "feishu_im_user_message",
    "feishu_im_user_search_messages",
    "feishu_search_doc_wiki",
    "feishu_get_user",
    "feishu_search_user",
    "feishu_sheet",
    "feishu_task_task",
    "feishu_task_tasklist",
    "feishu_task_attachment",
    "feishu_task_comment",
    "feishu_task_section",
    "feishu_task_subtask",
    "feishu_task_agent",
    "feishu_wiki_space",
    "feishu_wiki_space_node",
    "feishu_create_doc",
    "feishu_fetch_doc",
    "feishu_update_doc",
    "feishu_search_doc",
    "feishu_oauth",
    "feishu_oauth_batch_auth",
    "ask_user_form",
    "feishu_im_bot_image",
];

const plugin = {
    id: 'openclaw-lark',
    contracts: {
        tools: _TOOL_CONTRACTS,
    },
    register(api) { ... }
};




The plugin module correctly exports contracts: { tools: [...] } — the bug is in how OpenClaw's bundled capability runtime reads it.

【Impact】
All 27+ Feishu tools (bitable, calendar, task, chat, im, drive, wiki, doc, OAuth) are completely non-functional
The Feishu channel (IM messaging) still works for basic chat
Error floods logs: 41 diagnostics per plugin load

【Environment】
OpenClaw version: 2026.5.3-1 (2eae30e)
Platform: Windows 10 (x64)
Plugin path: D:\AI\Openclaw\.openclaw\extensions\openclaw-lark\
Bundled runtime: node_modules\openclaw\dist\bundled-capability-runtime-CQy4xWvL.js
Loader: node_modules\openclaw\dist\loader-DmHfdX8U.js

【Suggested Fix】
Pass contracts: manifestRecord.contracts in createCapabilityPluginRecord and propagate it from the manifest through the bundled runtime loading chain, matching what createPluginRecord already does in the loader path.

Fix Action

Fixed

PR fix notes

PR #78012: Fix bundled capability contract propagation

Description (problem / solution / changelog)

Summary

  • propagate manifest-owned contracts into bundled capability plugin records
  • keep tool contract validation manifest-owned; no module-export contract loading
  • add regressions for declared bundled tools and undeclared tool rejection

Fixes #77982.

Verification

  • Local workflow batch verification passed before PR branch extraction.
  • Targeted regression lives in src/plugins/bundled-capability-runtime.test.ts.

Changed files

  • src/plugins/bundled-capability-runtime.test.ts (modified, +113/-2)
  • src/plugins/bundled-capability-runtime.ts (modified, +4/-0)
RAW_BUFFERClick to expand / collapse

Bug Description

The openclaw-lark plugin declares tool contracts via contracts: { tools: [...] } in its export, but all 27+ tools fail registration with the error:

plugin must declare contracts.tools before registering agent tools

This error fires 41 times per plugin load (once per tool registration).

Root Cause Analysis

Traced through the OpenClaw source:

  1. createCapabilityPluginRecord in bundled-capability-runtime-CQy4xWvL.js (line ~259) does NOT include contracts in the returned object:
function createCapabilityPluginRecord(params) {
    return {
        id: params.id,
        name: params.name ?? params.id,
        // ... all other fields ...
        // ❌ NO `contracts` field
    };
}


2.Later, at line ~513, the bundled runtime calls:
const declaredToolNames = normalizePluginToolContractNames(record.contracts);
record.contracts is undefined → declaredToolNames is empty → every tool fails findUndeclaredPluginToolNames check.

3.Compare with createPluginRecord in loader-DmHfdX8U.js (line ~392), which correctly passes contracts: params.contracts:

function createPluginRecord(params) {
    return {
        // ...
        contracts: params.contracts  // ✅ present here
    };
}

4.But manifestRecord.contracts is never read from the plugin module export by the bundled runtime. The plugin's contracts field in its export is lost at the loadBundledCapabilityRuntimeRegistry level.
Plugin Code (verified correct)
// D:\AI\Openclaw\.openclaw\extensions\openclaw-lark\index.js

const _TOOL_CONTRACTS = [
    "feishu_bitable_app",
    "feishu_bitable_app_table",
    "feishu_bitable_app_table_field",
    "feishu_bitable_app_table_record",
    "feishu_bitable_app_table_view",
    "feishu_calendar_calendar",
    "feishu_calendar_event",
    "feishu_calendar_event_attendee",
    "feishu_calendar_freebusy",
    "feishu_chat",
    "feishu_chat_members",
    "feishu_doc_comments",
    "feishu_doc_media",
    "feishu_drive_file",
    "feishu_im_user_fetch_resource",
    "feishu_im_user_get_messages",
    "feishu_im_user_get_thread_messages",
    "feishu_im_user_message",
    "feishu_im_user_search_messages",
    "feishu_search_doc_wiki",
    "feishu_get_user",
    "feishu_search_user",
    "feishu_sheet",
    "feishu_task_task",
    "feishu_task_tasklist",
    "feishu_task_attachment",
    "feishu_task_comment",
    "feishu_task_section",
    "feishu_task_subtask",
    "feishu_task_agent",
    "feishu_wiki_space",
    "feishu_wiki_space_node",
    "feishu_create_doc",
    "feishu_fetch_doc",
    "feishu_update_doc",
    "feishu_search_doc",
    "feishu_oauth",
    "feishu_oauth_batch_auth",
    "ask_user_form",
    "feishu_im_bot_image",
];

const plugin = {
    id: 'openclaw-lark',
    contracts: {
        tools: _TOOL_CONTRACTS,
    },
    register(api) { ... }
};




The plugin module correctly exports contracts: { tools: [...] } — the bug is in how OpenClaw's bundled capability runtime reads it.

【Impact】
All 27+ Feishu tools (bitable, calendar, task, chat, im, drive, wiki, doc, OAuth) are completely non-functional
The Feishu channel (IM messaging) still works for basic chat
Error floods logs: 41 diagnostics per plugin load

【Environment】
OpenClaw version: 2026.5.3-1 (2eae30e)
Platform: Windows 10 (x64)
Plugin path: D:\AI\Openclaw\.openclaw\extensions\openclaw-lark\
Bundled runtime: node_modules\openclaw\dist\bundled-capability-runtime-CQy4xWvL.js
Loader: node_modules\openclaw\dist\loader-DmHfdX8U.js

【Suggested Fix】
Pass contracts: manifestRecord.contracts in createCapabilityPluginRecord and propagate it from the manifest through the bundled runtime loading chain, matching what createPluginRecord already does in the loader path.

extent analysis

TL;DR

The createCapabilityPluginRecord function should be updated to include the contracts field in the returned object to fix the tool registration issue.

Guidance

  • Update the createCapabilityPluginRecord function in bundled-capability-runtime-CQy4xWvL.js to include the contracts field, like this: contracts: params.contracts.
  • Verify that the contracts field is being passed correctly through the bundled runtime loading chain.
  • Check the loader-DmHfdX8U.js file to ensure that the createPluginRecord function is correctly passing the contracts field.
  • Test the updated code to ensure that the tool registration issue is resolved and the error messages are no longer flooding the logs.

Example

function createCapabilityPluginRecord(params) {
    return {
        id: params.id,
        name: params.name ?? params.id,
        // ... all other fields ...
        contracts: params.contracts, // Add this line
    };
}

Notes

The fix requires updating the createCapabilityPluginRecord function to include the contracts field, which is currently missing. This should resolve the tool registration issue and prevent the error messages from flooding the logs.

Recommendation

Apply the suggested fix by updating the createCapabilityPluginRecord function to include the contracts field, as this should resolve the issue and allow the tools to register correctly.

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