Environment
- OpenClaw: 2026.3.12
- Plugin: @martian-engineering/lossless-claw 0.3.0 (contextEngine slot)
- Channel: Telegram webhook
Problem
Context engine plugins that use api.runtime.subagent for delegated expansion (spawning sub-agents from tool execution) intermittently lose access to subagent methods during normal Telegram gateway requests.
Error: Plugin runtime subagent methods are only available during a gateway request
This worked reliably on 2026.3.11.
Details
The lossless-claw plugin registers tools (lcm_expand_query) that need to spawn sub-agents via api.runtime.subagent.run(). On 3.12, the subagent runtime is sometimes available and sometimes not within the same session.
Gateway logs show that successful calls are logged under [gateway] prefix, while failed calls appear under [plugins] prefix — suggesting the AsyncLocalStorage-scoped runtime context is not consistently propagated to plugin tool execution.
Suspected cause
The 3.12 security change "stop unauthenticated plugin HTTP routes from inheriting synthetic admin gateway scopes when they call runtime.subagent.*" may be overly broad, affecting authenticated context engine plugin tool calls during legitimate gateway requests.
Expected behavior
Context engine plugins registered in the contextEngine slot should have stable access to api.runtime.subagent during tool execution within a gateway request, same as 3.11.
Related
Environment
Problem
Context engine plugins that use
api.runtime.subagentfor delegated expansion (spawning sub-agents from tool execution) intermittently lose access to subagent methods during normal Telegram gateway requests.Error:
Plugin runtime subagent methods are only available during a gateway requestThis worked reliably on 2026.3.11.
Details
The lossless-claw plugin registers tools (
lcm_expand_query) that need to spawn sub-agents viaapi.runtime.subagent.run(). On 3.12, the subagent runtime is sometimes available and sometimes not within the same session.Gateway logs show that successful calls are logged under
[gateway]prefix, while failed calls appear under[plugins]prefix — suggesting the AsyncLocalStorage-scoped runtime context is not consistently propagated to plugin tool execution.Suspected cause
The 3.12 security change "stop unauthenticated plugin HTTP routes from inheriting synthetic admin gateway scopes when they call
runtime.subagent.*" may be overly broad, affecting authenticated context engine plugin tool calls during legitimate gateway requests.Expected behavior
Context engine plugins registered in the
contextEngineslot should have stable access toapi.runtime.subagentduring tool execution within a gateway request, same as 3.11.Related