You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
0.22: route web and Vega plugin process spawns and diagnostics through the plugin host #4862
Found in the review of #4857 (#4857 (comment)). #4857 fixes it for HarmonyOS only; the same fault is in the two platform plugins already merged into 0.22 (#4792 web, #4828 Vega).
Problem
A managed platform plugin bundles its own copy of @agent-device/host-kit (deps.alwaysBundle matches /^@agent-device\//). A runtime import of @agent-device/host-kit/command or @agent-device/host-kit/diagnostics inside the plugin therefore uses a second AsyncLocalStorage scope that the daemon's withCommandHost(...) never enters. In the packed plugin:
spawned tools inherit process.env, not the captured host.env (cwd and environment of the daemon host);
exec traces and timers go to the plugin's own diagnostics store, so --debug logs lose them.
Workspace tests resolve the plugin from src, where host-kit is one instance, so they do not see it.
Every process a managed platform plugin spawns and every diagnostic it emits goes through the PlatformHost passed to setup() (runCommand, emitDiagnostic, withDiagnosticTimer), as #4857 does for HarmonyOS. The layering rule that #4857 adds to scripts/layering/platform-package-policy.ts then holds for web and Vega without a register entry.
Completion conditions
No runtime import of @agent-device/host-kit/command or /diagnostics in packages/platform-web or packages/platform-vega; their entries leave the policy register.
A packed-plugin test per family that runs a command with the tool reachable only through the host environment, and asserts the spawn's environment.
One --debug log per family that shows the tool's exec record under the request id.
A decision, with a test, for the Limrun provider import.
Depends on #4857 merging first (it adds the rule and the host ports).
The issue reports existing wrong behavior where web and Vega plugins bundle separate host-kit instances, causing spawned process environments and diagnostics to bypass the daemon host context. It identifies affected files, expected behavior, and concrete completion checks, making it actionable.
Done in #4874 (merged into 0.22 as 5271581): web and Vega run every spawn, process read, install lock and diagnostic through the PlatformHost, and the layering rule derives the forbidden host-kit exports from its module graph.
Activity
apex-sentinel-staging commentedon Nov 20, 2026
Apex Sentinel · Issue review
Suggested label:
bugThe issue reports existing wrong behavior where web and Vega plugins bundle separate host-kit instances, causing spawned process environments and diagnostics to bypass the daemon host context. It identifies affected files, expected behavior, and concrete completion checks, making it actionable.
Required sections
thymikee commentedon Nov 21, 2026
Done in #4874 (merged into 0.22 as 5271581): web and Vega run every spawn, process read, install lock and diagnostic through the PlatformHost, and the layering rule derives the forbidden host-kit exports from its module graph.