Files
multica/server/pkg/taskfailure
f51ee62b53 MUL-6164 fix(agent): diagnose an unrunnable agent CLI instead of leaking "exec format error" (#6963)
* fix(agent): diagnose an unrunnable agent CLI instead of leaking "exec format error" (MUL-6164)

npm-distributed agent CLIs ship a placeholder text stub at their bin entry
point and rely on a postinstall script to overwrite it with the platform-native
binary. npm 12 blocks install scripts unless allowlisted, pnpm 10 needs
`pnpm approve-builds`, and --ignore-scripts / --omit=optional do the same — all
of them leave the stub in place with its executable bit set. exec.LookPath
accepts it, execve rejects it, so the CLI reads as installed everywhere the
daemon looks and only fails at launch with a bare
"start claude: fork/exec <path>: exec format error".

Add ExplainExecError: on ENOEXEC it names the path, the owning npm package, and
the exact repair command read out of that package's own scripts.postinstall.
The executable path is recovered from the error itself, so this is one
provider-agnostic call at each boundary — the shared version probe and the
daemon's single backend.Execute site — rather than a wrap in every backend.
claude and opencode ship this layout today; a CLI added later is covered
without a code change.

Also classify "exec format error" as runtime_missing_executable: a stub that
cannot exec means this host has no usable CLI, and that reason already tells
the daemon a fresh-session retry cannot help.

Co-authored-by: multica-agent <[email protected]>

* fix(agent): keep the ENOEXEC diagnosis to one copy (MUL-6164 review)

The openclaw preflight explained the error, then returned it through
openclawBackend.Execute into the daemon's launch boundary, which explained it
again — %w keeps ENOEXEC reachable, so the second pass fired and the user got
the same paragraph twice.

Drop the openclaw wrap: its error already travels through the daemon boundary,
so the extra site bought nothing. Make ExplainExecError idempotent as well, so
the next nested boundary cannot reintroduce the same regression silently.

Also quote the package root properly in the repair command — it is meant to be
pasted into a shell, and a path holding a quote or a space has to survive that.

The chat copy for runtime_missing_executable said the CLI "couldn't be found /
check it's on PATH", which is the opposite of this failure: the file is right
there on PATH and cannot run. Reworded to cover both across all four locales;
the compact labels ("Runner CLI not installed") are left for the follow-up that
reworks the reason's presentation.

Co-authored-by: multica-agent <[email protected]>

---------

Co-authored-by: Bohan-J <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-08-14 15:31:24 +08:00
..