mirror of
https://github.com/multica-ai/multica.git
synced 2026-07-05 13:29:44 +02:00
The per-task wrapper at envRoot/openclaw-config.json $includes the user's active config (typically ~/.openclaw/openclaw.json), but OpenClaw confines $include resolution to the wrapper file's directory unless the target's parent is granted via OPENCLAW_INCLUDE_ROOTS. Without this, OpenClaw refuses to follow the link at runtime and the wrapper boots with no user-registered agents. prepareOpenclawConfig now returns dirname(activePath) as IncludeRoot, and the daemon prepends it to whatever the user already has in OPENCLAW_INCLUDE_ROOTS via the new composeOpenclawIncludeRoots helper (dedupes, drops empty segments, preserves user-configured roots). Fresh install emits no $include and leaves the env var untouched. Adds OPENCLAW_INCLUDE_ROOTS to the custom_env blocklist so a per-agent override cannot strip the granted root. Regression tests: - TestPrepareOpenclawConfigWrapperLoadableUnderIncludeConfinement asserts every $include target's dirname is covered by the IncludeRoot we surface. - TestPrepareEnvironmentOpenclawWiresIncludeRoot covers the non-fresh-install Environment wiring. - TestComposeOpenclawIncludeRoots covers the daemon-side env composition (preserve, dedupe, drop empties). Co-authored-by: multica-agent <github@multica.ai>