{"record":{"id":"2cb729e510c315ad","repo":"openclaw/openclaw","slug":"label-must-be-a-valid-file-uri-error-instanc","errorCode":null,"errorMessage":"${label} must be a valid file URI: ${error instanceof Error ? error.message : String(error)}","messagePattern":"(.+?) must be a valid file URI: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts","lineNumber":12,"sourceCode":"/** Converts Codex PathUri protocol values into sandbox-backend path strings. */\nimport { fileURLToPath } from \"node:url\";\n\nconst WINDOWS_DRIVE_PATH_RE = /^\\/[A-Za-z]:(?:\\/|$)/u;\n\n/** Resolves one Codex exec-server PathUri into a POSIX sandbox path. */\nexport function resolveExecServerPath(rawPath: string, label: string): string {\n  let pathUrl: URL;\n  try {\n    pathUrl = new URL(rawPath);\n  } catch (error) {\n    throw new Error(\n      `${label} must be a valid file URI: ${error instanceof Error ? error.message : String(error)}`,\n      { cause: error },\n    );\n  }\n  if (pathUrl.protocol !== \"file:\") {\n    throw new Error(\n      `${label} URI must use the file scheme, received ${pathUrl.protocol.slice(0, -1)}.`,\n    );\n  }\n  if (pathUrl.search || pathUrl.hash) {\n    throw new Error(`${label} file URI must not include a query or fragment.`);\n  }\n  let resolved: string;\n  try {\n    // The URI names the sandbox target, so decode with POSIX rules even when\n    // the Gateway host is Windows. Docker and SSH backends own POSIX workdirs.\n    resolved = fileURLToPath(pathUrl, { windows: false });\n  } catch (error) {","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/openclaw/openclaw/blob/01804a75319da4b69c9ab98ceaa30477e22b8c0b/extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts#L1-L30","documentation":"Error \"${label} must be a valid file URI: ${error instanceof Error ? error.message : String(error)}\" thrown in openclaw/openclaw.","triggerScenarios":"Thrown at extensions/codex/src/app-server/sandbox-exec-server/path-uri.ts:12 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01804a75319da4b69c9ab98ceaa30477e22b8c0b","analyzedAt":"2026-08-12T04:37:58.197Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}