File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import fs from "node:fs/promises";
88import { homedir } from "node:os" ;
99import path from "node:path" ;
1010import { parseStrictInteger } from "@openclaw/normalization-core/number-coercion" ;
11+ import { expandHomePrefix } from "../infra/home-dir.js" ;
1112import { sliceUtf16Safe } from "../utils.js" ;
1213import { assertSandboxPath } from "./sandbox-paths.js" ;
1314import type { SandboxBackendExecSpec } from "./sandbox/backend-handle.types.js" ;
@@ -183,10 +184,11 @@ function normalizeContainerPath(input: string): string {
183184export function resolveWorkdir ( workdir : string , warnings : string [ ] ) {
184185 const current = safeCwd ( ) ;
185186 const fallback = current ?? homedir ( ) ;
187+ const expanded = expandHomePrefix ( workdir ) ;
186188 try {
187- const stats = statSync ( workdir ) ;
189+ const stats = statSync ( expanded ) ;
188190 if ( stats . isDirectory ( ) ) {
189- return workdir ;
191+ return expanded ;
190192 }
191193 } catch {
192194 // ignore, fallback below
You can’t perform that action at this time.
0 commit comments