[codex] Fix message CLI plugin preload failure exit (#76846)

Summary:
- The branch moves configured-channel plugin registry loading for `openclaw message` into `runCommandWithRuntime`, adds regression coverage for preload failure exit handling, and adds a changelog fix entry for #76168.
- Reproducibility: yes. for the exit-path bug: current main calls plugin registry preload before `runCommandWi ...  the high-CPU child process in this read-only review, but the missing exit boundary is source-reproducible.

Automerge notes:
- No ClawSweeper repair was needed after automerge opt-in.

Validation:
- ClawSweeper review passed for head 95b67ea9ba.
- Required merge gates passed before the squash merge.

Prepared head SHA: 95b67ea9ba
Review: https://github.com/openclaw/openclaw/pull/76846#issuecomment-4366747104

Co-authored-by: Peter Steinberger <steipete@gmail.com>
This commit is contained in:
Peter Steinberger
2026-05-03 18:32:36 +01:00
committed by GitHub
parent ec73e9985c
commit 11a08e3ef0
3 changed files with 17 additions and 2 deletions

View File

@@ -31,6 +31,7 @@ Docs: https://docs.openclaw.ai
- Agents/tools: stop treating `tools.deny: ["write"]` as an implicit `apply_patch` deny; operators who want to block patch writes should deny `apply_patch` or `group:fs` explicitly. Fixes #76749. (#76795) Thanks @Nek-12 and @hclsys.
- Plugins/release: verify published plugin npm tarballs expose compiled runtime entries after publish, catching TS-only package artifacts before release closeout. Thanks @vincentkoc.
- CLI/message: exit cleanly with a nonzero status when message-command plugin registry loading fails before dispatch, preventing `openclaw-message` children from staying alive after plugin load errors. Fixes #76168.
- Gateway/update: recover an installed-but-unloaded macOS LaunchAgent after package updates, rerun Gateway health/version/channel readiness checks, and print restart, reinstall, and rollback guidance before reporting update failure. (#76790) Thanks @jonathanlindsay.
- CLI/plugins: explain when a missing plugin command alias belongs to a bundled plugin that is disabled by default, including the `openclaw plugins enable <plugin>` repair command. (#76835)
- Google Meet: route stateful CLI session commands through the gateway-owned runtime so joined realtime sessions survive after the starting CLI process exits. Fixes #76344. Thanks @coltonharris-wq.

View File

@@ -136,6 +136,20 @@ describe("runMessageAction", () => {
});
});
it("exits with failure when plugin registry loading fails before dispatch", async () => {
vi.mocked(ensurePluginRegistryLoaded).mockImplementationOnce(() => {
throw new Error("plugin load failed");
});
await runSendAction();
expect(messageCommandMock).not.toHaveBeenCalled();
expect(errorMock).toHaveBeenCalledWith("Error: plugin load failed");
expect(exitMock).toHaveBeenCalledOnce();
expect(exitMock).toHaveBeenCalledWith(1);
expect(exitMock).not.toHaveBeenCalledWith(0);
});
it("runs gateway_stop hooks before exit when registered", async () => {
hasHooksMock.mockReturnValueOnce(true);
await runSendAction();

View File

@@ -82,12 +82,12 @@ export function createMessageCliHelpers(
const runMessageAction = async (action: string, opts: Record<string, unknown>) => {
setVerbose(Boolean(opts.verbose));
ensurePluginRegistryLoaded(resolveMessagePluginLoadOptions(opts));
const deps = createDefaultDeps();
let failed = false;
await runCommandWithRuntime(
defaultRuntime,
async () => {
ensurePluginRegistryLoaded(resolveMessagePluginLoadOptions(opts));
const deps = createDefaultDeps();
await messageCommand(
{
...normalizeMessageOptions(opts),