From 5ff283cfbba84a630c8e683c6e263720645ac4c4 Mon Sep 17 00:00:00 2001 From: Sarah Fortune Date: Wed, 6 May 2026 16:48:26 -0700 Subject: [PATCH] fix(cli/completion): guard shell profile source line with file-exists check (#78659) --- CHANGELOG.md | 1 + src/cli/completion-runtime.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0820e1ecf6..cb2827502d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -124,6 +124,7 @@ Docs: https://docs.openclaw.ai ### Fixes +- CLI/completion: guard the shell-profile source line written by `openclaw completion --install` with a file existence check (`[ -f ... ] && source ...` for bash/zsh, `test -f ...; and source ...` for fish) so uninstalling OpenClaw no longer makes new login shells error on a missing completion cache. - Cron/doctor: repair persisted cron jobs whose `payload.model` was stored as `"default"`, `"null"`, blank, or JSON `null` by removing the bad override during `openclaw doctor --fix` while keeping cron runtime model validation strict. Fixes #78549. Thanks @bizzle12368239. - Doctor/OpenAI Codex: revert the 2026.5.5 `doctor --fix` repair that rewrote valid `openai-codex/*` ChatGPT/Codex OAuth routes to `openai/*`, which could break OAuth-only GPT-5.5 setups or accidentally move users onto the OpenAI API-key route. If 2026.5.5 already changed your default model, run `openclaw models set openai-codex/gpt-5.5 && openclaw config validate` to switch the default agent back to the Codex OAuth PI route. Fixes #78407. - Discord/groups: instruct group-chat agents to stay silent when a message is addressed to someone else, replying only when invited or correcting key facts. (#78615) diff --git a/src/cli/completion-runtime.ts b/src/cli/completion-runtime.ts index 408eaffa478..b360b2d7659 100644 --- a/src/cli/completion-runtime.ts +++ b/src/cli/completion-runtime.ts @@ -69,9 +69,9 @@ function formatCompletionSourceLine( cachePath: string, ): string { if (shell === "fish") { - return `source "${cachePath}"`; + return `test -f "${cachePath}"; and source "${cachePath}"`; } - return `source "${cachePath}"`; + return `[ -f "${cachePath}" ] && source "${cachePath}"`; } function isCompletionProfileHeader(line: string): boolean {