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
- Start gateway — plugin loads, all tools available in main session
- Use
lcm_grep in main session — works (always)
- Use
lcm_describe in main session — works (always)
- Use
lcm_expand_query (spawns sub-agent) — works for first 2-3 calls
- Wait ~5 minutes or trigger sub-agent archival
- Use
lcm_expand_query again — fails with: plugin tool runtime missing (lossless-claw): lcm_expand_query
- All subsequent
lcm_expand_query calls fail permanently within the session
- Gateway restart temporarily fixes it, cycle repeats
Log evidence
Steps to reproduce
Reproduction
- Start gateway — plugin loads, all tools available in main session
- Use
lcm_grep in main session — works (always)
- Use
lcm_describe in main session — works (always)
- Use
lcm_expand_query (spawns sub-agent) — works for first 2-3 calls
- Wait ~5 minutes or trigger sub-agent archival
- Use
lcm_expand_query again — fails with: plugin tool runtime missing (lossless-claw): lcm_expand_query
- All subsequent
lcm_expand_query calls fail permanently within the session
- 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
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.toolsrequirement 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
api.registerTool((ctx) => ...)Plugin setup (all requirements met)
openclaw.plugin.jsonhas"contracts": { "tools": ["lcm_grep", "lcm_describe", "lcm_expand", "lcm_expand_query"] }package.jsonhas"main": "dist/index.js"and"openclaw": { "extensions": ["./dist/index.js"] }dist/viatsc[lcm] Plugin loadedwith zero errorsReproduction
lcm_grepin main session — works (always)lcm_describein main session — works (always)lcm_expand_query(spawns sub-agent) — works for first 2-3 callslcm_expand_queryagain — fails with:plugin tool runtime missing (lossless-claw): lcm_expand_querylcm_expand_querycalls fail permanently within the sessionLog evidence
Steps to reproduce
Reproduction
lcm_grepin main session — works (always)lcm_describein main session — works (always)lcm_expand_query(spawns sub-agent) — works for first 2-3 callslcm_expand_queryagain — fails with:plugin tool runtime missing (lossless-claw): lcm_expand_querylcm_expand_querycalls fail permanently within the sessionExpected 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