{"record":{"id":"38d300ff565fc393","repo":"paperclipai/paperclip","slug":"daytona-file-sync-requires-a-workspace-remote-dir","errorCode":null,"errorMessage":"Daytona file sync requires a workspace remote dir on the lease metadata.","messagePattern":"Daytona file sync requires a workspace remote dir on the lease metadata\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/sandbox-providers/daytona/src/plugin.ts","lineNumber":914,"sourceCode":"  // surface the right exit code.\n  const finalLine = envArgs.length > 0\n    ? `env ${envArgs.join(\" \")} ${redirectedCommand}`\n    : redirectedCommand;\n  const lines = [\n    'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',\n    'if [ -f \"$HOME/.profile\" ]; then . \"$HOME/.profile\" >/dev/null 2>&1 || true; fi',\n    // .bash_profile typically sources .bashrc itself; only source .bashrc\n    // directly when no .bash_profile exists to avoid double-running setup.\n    'if [ -f \"$HOME/.bash_profile\" ]; then . \"$HOME/.bash_profile\" >/dev/null 2>&1 || true; elif [ -f \"$HOME/.bashrc\" ]; then . \"$HOME/.bashrc\" >/dev/null 2>&1 || true; fi',\n    'if [ -f \"$HOME/.zprofile\" ]; then . \"$HOME/.zprofile\" >/dev/null 2>&1 || true; fi',\n  ];\n  if (input.cwd) {\n    lines.push(`cd ${shellQuote(input.cwd)}`);\n  }\n  lines.push(finalLine);\n  return lines.join(\" && \");\n}\n\n// The workspace remote dir is the confinement root for native file sync. It is\n// recorded on the lease metadata at acquire/resume time; require it so a sync can\n// never run without a concrete root to confine every sandbox path against.\nfunction resolveSyncRemoteDir(lease: { metadata?: Record<string, unknown> | null }): string {\n  const remoteCwd = lease.metadata?.remoteCwd;\n  if (typeof remoteCwd === \"string\" && remoteCwd.trim().length > 0) {\n    return remoteCwd.trim();\n  }\n  throw new Error(\"Daytona file sync requires a workspace remote dir on the lease metadata.\");\n}\n\nasync function createSandbox(\n  params: PluginEnvironmentAcquireLeaseParams | PluginEnvironmentProbeParams | PluginEnvironmentStartInteractiveSetupParams,\n  config: DaytonaDriverConfig,\n  options: { purpose?: string } = {},\n): Promise<Sandbox> {\n  const resourceRequestError = validateRuntimeResourceRequest(config);\n  if (resourceRequestError) {","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/paperclipai/paperclip/blob/3f1d897a7c018d76563a21c6e39c3c9b03933622/packages/plugins/sandbox-providers/daytona/src/plugin.ts#L896-L932","documentation":"Confinement precondition in resolveSyncRemoteDir: the lease metadata carries no non-empty remoteCwd, so there is no workspace remote dir to confine every sandbox sync path against. The dir is recorded at acquire/resume time; if it is missing the sync refuses to run rather than operating without a confinement root.","triggerScenarios":"Thrown at packages/plugins/sandbox-providers/daytona/src/plugin.ts:867 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the lease metadata includes workspaceRemoteDir before file sync."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3f1d897a7c018d76563a21c6e39c3c9b03933622","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}