-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug]: Plugin-backed channels can become unknown in subagent flows when OPENCLAW_STATE_DIR is relative #52250
Description
Bug type
Behavior bug (incorrect output/state without crash)
Summary
A plugin-backed channel that is recognized before a subagent/tool-resolution path can become unknown afterward when OPENCLAW_STATE_DIR is relative.
Steps to reproduce
- Clone https://github.com/PerfectPan/openclaw-repro-plugin-registry-subagent
- Run
pnpm install - Run
OPENCLAW_REPO_DIR=<unfixed-openclaw-checkout> pnpm repro - Observe
before.isDemoFeishuChannelKnown = trueandafter.isDemoFeishuChannelKnown = false - Run
OPENCLAW_REPO_DIR=<same-checkout> pnpm repro:absolute-state-dir - Observe
before = trueandafter = true
Expected behavior
Resolving plugin tools should not replace the active plugin registry, so the same plugin-backed channel should remain recognized after the subagent/tool-resolution path runs.
Actual behavior
In the broken repro path, the plugin-backed channel is recognized before the second plugin load and becomes unknown afterward. In the control case with an absolute state dir, the channel stays recognized.
OpenClaw version
ff6541f (dynamic repro target); current main still appears affected by source inspection at 5137a51
Operating system
macOS 26.3.1 (arm64)
Install method
local source checkout via pnpm / browser-use repro repo
Model
N/A (no model call required to reproduce)
Provider / routing chain
N/A (no provider routing required to reproduce)
Additional provider/model setup details
The reproducer uses a minimal local plugin-backed channel (demo-feishu) instead of the real feishu plugin, so no external service is required. The failure depends on a relative OPENCLAW_STATE_DIR, a later cwd change, and a second plugin load triggered by resolvePluginTools().
Logs, screenshots, and evidence
Standalone repro repo: https://github.com/PerfectPan/openclaw-repro-plugin-registry-subagent
Observed in broken path:
- `pnpm repro` -> `before.isDemoFeishuChannelKnown = true`, `after.isDemoFeishuChannelKnown = false`
Observed in control path:
- `pnpm repro:absolute-state-dir` -> `before = true`, `after = true`Impact and severity
Affected: users of plugin-backed channels such as feishu or custom channel plugins in subagent/spawned-agent flows with a relative state dir
Severity: High in the affected flow because the channel becomes unusable
Frequency: Deterministic in the attached repro
Consequence: plugin-backed channels fail validation as unknown channel
Additional information
This became reproducible in our setup after e6897c800bbf74d730d130ac0197a72cc9562e4d (Plugins: fix env-aware root resolution and caching, March 12, 2026). Based on current source inspection, resolvePluginTools() still calls loadOpenClawPlugins() without activate: false, and explicit relative state-dir overrides are still cwd-sensitive. A likely fix is to make tool resolution use a non-activating, non-cached plugin snapshot and to normalize explicit state-dir overrides to absolute paths early in startup.