Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

fix(refresh): word the child-CLI remediation so the CLI-surface scan resolves it (#7686)

garrytan71a11ee8b78b
diff --git a/src/core/persistence/worktree-refresh.ts b/src/core/persistence/worktree-refresh.ts
index 4ab44d0c47..9d1f972cd5 100644
--- a/src/core/persistence/worktree-refresh.ts
+++ b/src/core/persistence/worktree-refresh.ts
@@ -311,8 +311,8 @@ const PUBLISH_TIMEOUT_MS = 600_000;
async function publishInChild(root: string, sourceId: string): Promise<{ sha: string | null; integrated: number; quarantined?: QuarantineEntry; superseded_remote_paths?: string[] }> {
const { CHILD_ENV, resolveChildCliInvocation } = await import('../minions/job-isolation.ts');
const cli = resolveChildCliInvocation(process.env, process.execPath, process.argv[1], () => null);
- if (!cli) throw opError('git_push_unavailable', `This process could not locate its own gbrain executable to publish the diverged checkout ${root}; nothing was pushed.`,
- `Set ${CHILD_ENV.childCliOverride} to the gbrain executable and retry gbrain sources refresh ${sourceId}, or publish by hand: gbrain git commit-push --push-only --keep-checkout --path ${q(root)}.`);
+ if (!cli) throw opError('git_push_unavailable', `This process could not locate its own CLI executable to publish the diverged checkout ${root}; nothing was pushed.`,
+ `Set ${CHILD_ENV.childCliOverride} to the path of the CLI executable and retry gbrain sources refresh ${sourceId}, or publish by hand: gbrain git commit-push --push-only --keep-checkout --path ${q(root)}.`);
const child = await execFileBounded(cli.cmd, [...cli.argsPrefix, 'git', 'commit-push', '--push-only', '--keep-checkout', '--path', root, '--json'], {
timeout: PUBLISH_TIMEOUT_MS, termGraceMs: 10_000, maxBuffer: 1024 * 1024,
env: { ...process.env, GBRAIN_PUBLISH_LOCK_WAIT_SECONDS: '0', GBRAIN_PUSH_LOCK_WAIT_SECONDS: '0' },