Skip to content

ContextEngine plugin runtime.subagent access intermittently unavailable during gateway requests in 2026.3.12 #45059

@threehotpot-bot

Description

@threehotpot-bot

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions