{"record":{"id":"c3d9368dfd0eef69","repo":"paperclipai/paperclip","slug":"enoent","errorCode":"ENOENT","errorMessage":"No such file: ${remotePath}","messagePattern":"No such file: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/adapter-utils/src/command-managed-runtime.ts","lineNumber":354,"sourceCode":"    },\n    readFile: async (remotePath, options) => {\n      // Chunked reads intentionally query the remote size first, even without\n      // a progress sink, so each sandbox RPC stays bounded and truncation is\n      // detected without materializing the whole file as one stdout string.\n      let sizeResult;\n      try {\n        sizeResult = await runShell(`wc -c < ${shellQuote(remotePath)}`);\n      } catch (error) {\n        // Shell-backed sandbox reads need the same absent-file contract as fs.\n        // Confirm the parent is searchable so permission/transport failures are\n        // never silently converted into a missing optional credential file.\n        const parent = shellQuote(path.posix.dirname(remotePath));\n        const missing = await runShell(\n          `if [ -d ${parent} ] && [ -x ${parent} ] && [ ! -e ${shellQuote(remotePath)} ]; ` +\n            `then printf 'missing'; fi`,\n        ).catch(() => null);\n        if (missing?.stdout === \"missing\") {\n          throw Object.assign(new Error(`No such file: ${remotePath}`), {\n            code: \"ENOENT\",\n            path: remotePath,\n          });\n        }\n        throw error;\n      }\n      const totalBytes = Number.parseInt(sizeResult.stdout.trim(), 10);\n      if (!Number.isFinite(totalBytes) || totalBytes < 0) {\n        throw new Error(`Could not determine remote file size for ${remotePath}`);\n      }\n\n      // Read in bounded remote chunks so the runner never has to materialize a\n      // single base64 stdout string for the whole archive. The client API still\n      // returns the decoded file as a Buffer, but every command result stays\n      // small enough for provider-backed sandbox RPCs.\n      const decodedChunks: Buffer[] = [];\n      let decodedSoFar = 0;\n      if (totalBytes === 0) {","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/adapter-utils/src/command-managed-runtime.ts#L336-L372","documentation":"ENOENT-contract emulation in the shell-backed sandbox filesystem client: readFile first runs `wc -c < remotePath` to bound chunked reads; when that shell command fails and the parent directory is confirmed searchable (so it is not a permission/transport problem), the client normalizes the failure to the same 'No such file' error the fs API would throw for an absent file. It is a deliberate sentinel mapping, not an unexpected crash.","triggerScenarios":"Thrown at packages/adapter-utils/src/command-managed-runtime.ts:354 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat this error like fs ENOENT: check the remote path exists (correct cwd/absolute path) before reading.","If the file should exist, verify it was created by an earlier step and the path spelling (case, separators) matches.","For deletion races, re-check existence or tolerate absence in the caller before reading."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-09-18T08:03:59.046Z","contentChangedAt":"2026-09-18T08:03:59.046Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}