Skip to content

fix(plugins): preserve bundled capability manifest contracts#81312

Open
yfge wants to merge 2 commits into
openclaw:mainfrom
yfge:fix/issue-77982
Open

fix(plugins): preserve bundled capability manifest contracts#81312
yfge wants to merge 2 commits into
openclaw:mainfrom
yfge:fix/issue-77982

Conversation

@yfge

@yfge yfge commented May 13, 2026

Copy link
Copy Markdown
Contributor

Background

  • bundled capability runtime rebuilt plugin records without carrying manifest.contracts forward
  • that drops contracts.tools (and other declared contract metadata) for bundled capability plugins like Feishu/Lark
  • downstream contract-based tooling sees the plugin as if it declared no tool contracts

Changes

  • pass manifest.contracts into createCapabilityPluginRecord(...)
  • persist the contracts on the synthesized bundled capability plugin record
  • initialize contract-backed provider id lists from the manifest data, matching normal plugin record creation
  • add a regression test that verifies bundled capability runtime keeps manifest contracts for memory-core

Verification

  • pnpm test src/plugins/bundled-capability-runtime.test.ts
  • pnpm exec oxfmt --check --threads=1 src/plugins/bundled-capability-runtime.ts src/plugins/bundled-capability-runtime.test.ts
  • node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/plugins/bundled-capability-runtime.ts src/plugins/bundled-capability-runtime.test.ts
  • pnpm build

Impact

  • restores bundled capability manifest contract metadata for Feishu/Lark and other bundled capability plugins
  • keeps contract-driven tool/provider resolution aligned with the main plugin loader path

Fixes #77982

Real behavior proof

  • Behavior or issue addressed: bundled capability runtime preserves manifest.contracts on synthesized bundled capability plugin records instead of dropping them during registry loading.
  • Real environment tested: local OpenClaw source checkout on macOS with the real bundled-capability runtime loader path, using the PR branch code against the repository's actual plugin manifests.
  • Exact steps or command run after this patch: ran the focused runtime/registry proof on the PR branch by loading the bundled capability registry and printing the synthesized memory-core / feishu records after runtime initialization.
  • Evidence after fix:
$ ./node_modules/.bin/vitest run src/plugins/bundled-capability-runtime.test.ts
✓ unit-fast ../../src/plugins/bundled-capability-runtime.test.ts (2 tests)
  ✓ preserves manifest contracts for bundled capability plugins

Test Files  1 passed (1)
Tests       2 passed (2)
$ pnpm exec tsx -e 'loadBundledCapabilityRuntimeRegistry(...)'
{
  "memoryCore": {
    "contracts": {
      "memoryEmbeddingProviders": ["local"],
      "tools": ["memory_get", "memory_search"]
    },
    "memoryEmbeddingProviderIds": ["local", "local"]
  },
  "feishu": {
    "contracts": {
      "tools": [
        "feishu_app_scopes",
        "feishu_bitable_create_app",
        "feishu_bitable_create_field",
        "feishu_bitable_create_record",
        "feishu_bitable_get_meta",
        "feishu_bitable_get_record",
        "feishu_bitable_list_fields",
        "feishu_bitable_list_records",
        "feishu_bitable_update_record",
        "feishu_chat",
        "feishu_doc",
        "feishu_drive",
        "feishu_perm",
        "feishu_wiki"
      ]
    },
    "toolNames": []
  }
}
  • Observed result after fix: the synthesized bundled capability records keep manifest.contracts for both memory-core and feishu after registry loading, which is the runtime behavior this bug was dropping before the patch.
  • What was not tested: no live Feishu/Lark message send flow; this proof covers the real bundled-capability runtime load path and emitted runtime records rather than downstream API traffic.

@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 13, 2026
@clawsweeper

clawsweeper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 3, 2026, 11:48 PM ET / 03:48 UTC.

Summary
The PR preserves manifest contracts on synthesized bundled capability plugin records, seeds/deduplicates contract-backed provider id lists, and adds regression coverage for bundled capability loading.

PR surface: Source +51, Tests +20. Total +71 across 3 files.

Reproducibility: yes. source-level: current main creates bundled capability PluginRecords without contracts and then validates captured tools against record.contracts, while affected bundled manifests declare contracts.tools.

Review metrics: 1 noteworthy metric.

  • Bundled record contract hydration: 1 contracts field preserved; 13 provider-id arrays seeded/deduped. This quantifies the compatibility-sensitive runtime record surface that changes before bundled plugins register captured capabilities.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #77982
Summary: This PR is the active focused candidate fix for the canonical bundled capability manifest-contract propagation bug; the earlier attempt is closed unmerged and the broader maintainer PR overlaps but is draft/conflicting.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • Refresh or explain the failed checks-node-core-tooling check.
  • Choose sequencing with the overlapping broader hardening PR.

Risk before merge

  • [P1] Merging intentionally changes bundled PluginRecord contract and provider-id projection semantics consumed by plugin discovery and tool/provider registration.
  • [P1] The current PR head still has a failed checks-node-core-tooling check, so merge needs a green rerun or a clear unrelated-failure confirmation.
  • [P1] The broader hardening PR overlaps the same bundled manifest-contract propagation but is draft and conflicting, so maintainers should choose sequencing rather than accidentally split or duplicate the fix.

Maintainer options:

  1. Refresh checks, then land focused fix (recommended)
    Rerun or clear the failed current-head tooling check, accept the bundled PluginRecord parity change, and land this focused fix before rebasing broader hardening.
  2. Fold into broader hardening only deliberately
    Pause or close this PR only if maintainers make fix(plugins): isolate bundled capability capture fields #90068 canonical and preserve this PR's contract propagation plus regression coverage there.

Next step before merge

  • [P2] Manual review remains because the patch is code-correct but needs maintainer compatibility acceptance, current-head check refresh, and sequencing with the overlapping draft PR.

Security
Cleared: No concrete security or supply-chain regression was found; the diff changes in-memory plugin runtime record projection and tests without new dependencies, workflows, secrets, downloads, or package resolution.

Review details

Best possible solution:

Land this focused manifest-contract propagation after maintainer compatibility acceptance and green or explained current-head checks, or explicitly fold the same fix and regression coverage into the broader hardening PR before closing this PR.

Do we have a high-confidence way to reproduce the issue?

Yes, source-level: current main creates bundled capability PluginRecords without contracts and then validates captured tools against record.contracts, while affected bundled manifests declare contracts.tools.

Is this the best way to solve the issue?

Yes, with a sequencing caveat: preserving manifest.contracts on the synthesized bundled PluginRecord is the narrow manifest-first fix and aligns the bundled runtime with the normal loader record path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 9d68f877ac3e.

Label changes

Label justifications:

  • P1: The PR fixes a high-impact bundled plugin tool-registration failure that can block manifest-declared Feishu/Lark-style tools.
  • merge-risk: 🚨 compatibility: The diff changes bundled PluginRecord contract and provider-id projection semantics consumed by plugin discovery and tool/provider registration.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body includes after-fix bundled registry live output for memory-core and Feishu plus focused test output, directly exercising the runtime-record behavior changed by this patch.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes after-fix bundled registry live output for memory-core and Feishu plus focused test output, directly exercising the runtime-record behavior changed by this patch.
Evidence reviewed

PR surface:

Source +51, Tests +20. Total +71 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 89 38 +51
Tests 2 21 1 +20
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 110 39 +71

What I checked:

Likely related people:

  • steipete: Prior commits derive bundled contracts from extension manifests and stabilize bundled capability contract loading, which is the same manifest-first runtime surface. (role: feature-history contributor; confidence: high; commits: ba7804df50d4, 71a3ad153ad1; files: src/plugins/bundled-capability-runtime.ts)
  • shakkernerd: Commit 7641783 added contracts.tools enforcement in the bundled runtime and normal registry, making missing bundled record contracts user-visible. (role: introduced related contract enforcement; confidence: high; commits: 7641783d6b0e; files: src/plugins/bundled-capability-runtime.ts, src/plugins/registry.ts, src/plugins/tool-contracts.ts)
  • dutifulbob: Commit ae4806e touched loader-record contract projection while adding embedding provider contracts, adjacent to the provider-id parity this PR changes. (role: adjacent contract surface contributor; confidence: medium; commits: ae4806ed9adf; files: src/plugins/loader-records.ts, src/plugins/loader-records.test.ts, src/plugins/bundled-capability-runtime.ts)
  • doodlewind: Commit 2267d58 replaced the Feishu/Lark plugin surface whose manifest-declared tools are affected by the bundled contract propagation bug. (role: affected plugin feature-history contributor; confidence: medium; commits: 2267d58afcc7; files: extensions/feishu/openclaw.plugin.json, extensions/feishu/index.ts, extensions/feishu/src)
  • vincentkoc: The open broader hardening PR also carries manifest contracts into bundled records, making this person relevant for sequencing this focused fix with adjacent work. (role: overlapping broader fix owner; confidence: medium; commits: 81be743a5eef; files: src/plugins/bundled-capability-runtime.ts, src/plugins/bundled-capability-runtime.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@yfge

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented May 13, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@yfge

This comment was marked as spam.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 13, 2026
@openclaw-barnacle openclaw-barnacle Bot added proof: supplied External PR includes structured after-fix real behavior proof. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels May 13, 2026
@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label May 14, 2026
@yfge

This comment was marked as spam.

@clawsweeper

clawsweeper Bot commented May 15, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jun 2, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. labels Jun 2, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Jun 2, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Jun 15, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 15, 2026
@clawsweeper

clawsweeper Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 15, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 15, 2026
@openclaw-barnacle openclaw-barnacle Bot removed the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Jun 16, 2026
@clawsweeper clawsweeper Bot removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 16, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 17, 2026
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale due to inactivity.
Please add updates or it will be closed.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Jul 19, 2026
@clawsweeper

clawsweeper Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(plugins): preserve bundled capability manifest contracts This is item 1/1 in the current shard. Shard 16/20.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: supplied External PR includes structured after-fix real behavior proof. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S stale Marked as stale due to inactivity status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] openclaw-lark plugin: contracts.tools not propagated through createCapabilityPluginRecord

1 participant