openclaw - 💡(How to fix) Fix bug(plugins): plugin tools intermittently unavailable in sub-agent sessions despite contracts.tools and compiled dist (regression from #56208)

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…

Plugin-registered tools become unavailable in sub-agent sessions after 2-3 successful calls within the same gateway session. The tools work initially, then permanently fail with "plugin tool runtime missing" for the remainder of the session. Gateway restart temporarily restores functionality.

This appears to be a regression of #56208 (fixed by #56240 in 2026.3.x), reintroduced by the contracts.tools requirement and/or plugin registry validation changes in 2026.5.x. Related to #76603 (disabled plugins dropping all plugin tools) and #77826 (config writes dropping plugin tools).

Error Message

20:51:33 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query 20:51:45 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query 20:52:01 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query

Root Cause

Plugin-registered tools become unavailable in sub-agent sessions after 2-3 successful calls within the same gateway session. The tools work initially, then permanently fail with "plugin tool runtime missing" for the remainder of the session. Gateway restart temporarily restores functionality.

This appears to be a regression of #56208 (fixed by #56240 in 2026.3.x), reintroduced by the contracts.tools requirement and/or plugin registry validation changes in 2026.5.x. Related to #76603 (disabled plugins dropping all plugin tools) and #77826 (config writes dropping plugin tools).

Fix Action

Fix / Workaround

This appears to be a regression of #56208 (fixed by #56240 in 2026.3.x), reintroduced by the contracts.tools requirement and/or plugin registry validation changes in 2026.5.x. Related to #76603 (disabled plugins dropping all plugin tools) and #77826 (config writes dropping plugin tools).

RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Summary

Plugin-registered tools become unavailable in sub-agent sessions after 2-3 successful calls within the same gateway session. The tools work initially, then permanently fail with "plugin tool runtime missing" for the remainder of the session. Gateway restart temporarily restores functionality.

This appears to be a regression of #56208 (fixed by #56240 in 2026.3.x), reintroduced by the contracts.tools requirement and/or plugin registry validation changes in 2026.5.x. Related to #76603 (disabled plugins dropping all plugin tools) and #77826 (config writes dropping plugin tools).

Environment

  • OpenClaw: 2026.5.7 (eeef486)
  • Platform: Ubuntu 24.04, Node 22.22.2
  • Plugin: custom lossless-claw (LCM), registers 4 tools via context-factory api.registerTool((ctx) => ...)

Plugin setup (all requirements met)

  • openclaw.plugin.json has "contracts": { "tools": ["lcm_grep", "lcm_describe", "lcm_expand", "lcm_expand_query"] }
  • package.json has "main": "dist/index.js" and "openclaw": { "extensions": ["./dist/index.js"] }
  • TypeScript compiled to dist/ via tsc
  • Plugin loads cleanly at gateway start: [lcm] Plugin loaded with zero errors

Reproduction

  1. Start gateway — plugin loads, all tools available in main session
  2. Use lcm_grep in main session — works (always)
  3. Use lcm_describe in main session — works (always)
  4. Use lcm_expand_query (spawns sub-agent) — works for first 2-3 calls
  5. Wait ~5 minutes or trigger sub-agent archival
  6. Use lcm_expand_query again — fails with: plugin tool runtime missing (lossless-claw): lcm_expand_query
  7. All subsequent lcm_expand_query calls fail permanently within the session
  8. Gateway restart temporarily fixes it, cycle repeats

Log evidence

Steps to reproduce

Reproduction

  1. Start gateway — plugin loads, all tools available in main session
  2. Use lcm_grep in main session — works (always)
  3. Use lcm_describe in main session — works (always)
  4. Use lcm_expand_query (spawns sub-agent) — works for first 2-3 calls
  5. Wait ~5 minutes or trigger sub-agent archival
  6. Use lcm_expand_query again — fails with: plugin tool runtime missing (lossless-claw): lcm_expand_query
  7. All subsequent lcm_expand_query calls fail permanently within the session
  8. Gateway restart temporarily fixes it, cycle repeats

Expected behavior

Plugin tools declared in contracts.tools and successfully registered during register() should be available to all sub-agent sessions for the lifetime of the gateway process, regardless of sub-agent archival and respawn cycles.

Actual behavior

First call — works: 20:35:12 info agent — lcm_expand_query delegation: success (expansionDepth:1) Later call — permanent failure: 20:51:33 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query 20:51:45 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query 20:52:01 error agent — lcm_expand_query failed: plugin tool runtime missing (lossless-claw): lcm_expand_query

OpenClaw version

2026.5.7

Operating system

Ubuntu 24.04, Node 22.22.2

Install method

nmp global

Model

claude opus 4.6

Provider / routing chain

openclaw

Additional provider/model setup details

Suggested fix

The #56240 fix (reuse active registry) needs to be extended to cover sub-agent respawn after archival. When a new sub-agent context is created and the parent gateway has an active plugin registry with the tool already registered, the sub-agent should inherit that registry rather than racing loadOpenClawPlugins() again. Alternatively, contracts.tools declarations should be treated as pre-registered tool stubs that satisfy the tool resolver even before register() runs — which was the alternative suggestion in #56208.

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

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…

FAQ

Expected behavior

Plugin tools declared in contracts.tools and successfully registered during register() should be available to all sub-agent sessions for the lifetime of the gateway process, regardless of sub-agent archival and respawn cycles.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix bug(plugins): plugin tools intermittently unavailable in sub-agent sessions despite contracts.tools and compiled dist (regression from #56208)