Skip to content

Commit 4417a65

Browse files
committed
refactor(cli): complete agent exec owner migration
1 parent a4874b1 commit 4417a65

4 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎config/assertion-safety-baseline.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2443,7 +2443,7 @@ src/cli/update-cli/update-command-config.ts 6
24432443
src/cli/update-cli/update-command-plugins.ts 1
24442444
src/cli/update-cli/update-command-post-update.ts 2
24452445
src/cli/users-cli.ts 1
2446-
src/commands/agent-exec.ts 6
2446+
src/commands/agent-exec.ts 1
24472447
src/commands/agent-via-gateway.ts 7
24482448
src/commands/agents.commands.bind.ts 5
24492449
src/commands/agents.commands.identity.ts 1

‎scripts/code-mode-model-matrix.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
type QaEvidenceStatus,
1616
type QaEvidenceSummaryJson,
1717
} from "../extensions/qa-lab/api.js";
18-
import type { AgentExecEnvelope } from "../src/commands/agent-exec.ts";
18+
import type { AgentExecEnvelope } from "../src/commands/agent-exec-result.ts";
1919
import { requireOptionArgument } from "./lib/arg-utils.mts";
2020
import { previewForDevToolLog, redactJsonValueForDevToolLog } from "./lib/dev-tooling-safety.ts";
2121

‎scripts/lib/config-boundary-guard.mts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const PROCESS_BOUNDARY_DIRECT_CONFIG_LOAD_FILES = new Set([
4040
// reads the ambient location and resolves from an already published runtime
4141
// snapshot, so it cannot express a pinned run; the file-scoped loader is the
4242
// point. Ambient resolution in the same command does use `getRuntimeConfig()`.
43-
"src/commands/agent-exec.ts",
43+
"src/commands/agent-exec-input.ts",
4444
]);
4545

4646
const BROAD_CONFIG_RUNTIME_COMPAT_FILES = new Set([

‎src/commands/agent-exec-input.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export async function resolveAgentExecPrompt(
6767
if (file === "-" || !(error instanceof Error) || !("code" in error)) {
6868
throw error;
6969
}
70-
const code = (error as NodeJS.ErrnoException).code;
70+
const code = error.code;
7171
if (code === "ENOENT") {
7272
throw new Error(`Message file not found: ${file}`, { cause: error });
7373
}
@@ -117,7 +117,7 @@ function stripInheritedAgentLocations(base: OpenClawConfig): OpenClawConfig {
117117
}),
118118
),
119119
},
120-
} as OpenClawConfig;
120+
};
121121
}
122122

123123
function buildExecRunOverlay(params: {
@@ -143,7 +143,7 @@ function buildExecRunOverlay(params: {
143143
// This process exits after one turn, so live skill invalidation cannot be
144144
// observed and would leave Chokidar retaining the otherwise-finished CLI.
145145
skills: { load: { watch: false } },
146-
} as OpenClawConfig;
146+
};
147147
}
148148

149149
/**
@@ -223,9 +223,8 @@ export function buildExecRunConfig(params: {
223223
}): OpenClawConfig {
224224
const opts = params.opts ?? {};
225225
const base = stripInheritedAgentLocations(params.base);
226-
const withDefaults = mergeDeep(buildExecConfigDefaults(), base) as OpenClawConfig;
227226
return mergeDeep(
228-
withDefaults,
227+
mergeDeep(buildExecConfigDefaults(), base),
229228
buildExecRunOverlay({ base, cwd: params.cwd, opts }),
230-
) as OpenClawConfig;
229+
) as OpenClawConfig; // SAFETY: Merging three typed configs preserves the OpenClawConfig shape.
231230
}

0 commit comments

Comments
 (0)