paperclipai/paperclip · error · Error
provision stageFile.name must be a simple basename, got
Error message
provision stageFile.name must be a simple basename, got: ${safeName} What it means
Sandbox provisioning validated a stage file name that is not a simple basename (contains path separators or traversal); staged files must be copied to the sandbox root by name only, so path-shaped names are rejected.
Solutions
- Use a simple basename (no path separators) for stageFile.name.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at packages/adapter-utils/src/sandbox-managed-runtime.ts:983 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-08-21).
Data as JSON: /api/errors/92457c0421c4f111.
Report an issue: GitHub.
Appendix: source
Thrown at packages/adapter-utils/src/sandbox-managed-runtime.ts:1199
)))
: null;
// Every inbound staging step delegates to the provider through `client.syncIn`:
// the orchestrator no longer inlines `writeFile`+`run` or chooses a transport,
// and there is no `usesCustomProvision` native-diversion gate. `syncIn` is
// ALWAYS present in production — the command-managed client exposes a native
// transport (Daytona/Kubernetes `uploadFiles` + provider-executed post-upload
// commands) or a byte-identical base64-tar fallback that reproduces the prior
// `writeFile`+`run` sequence. Require it explicitly so a misconfigured client
// fails loud rather than silently skipping staging. `syncOut` stays optional
// (native-only) with a tar fallback on the restore path below.
const syncIn = input.client.syncIn;
if (typeof syncIn !== "function") {
throw new Error(
"prepareSandboxManagedRuntime requires a client that exposes syncIn " +
"(createCommandManagedRuntimeClient provides a native-or-fallback implementation).",
);
}
const nativeSyncOut = typeof input.client.syncOut === "function";
let syncOperationSeq = 0;
// Opaque, ordered, non-sensitive operation tokens — never a caller/asset id.
const nextSyncOperationId = () => `sync-op-${++syncOperationSeq}`;
// Remote directory of each additional (referenced) project that stages
// successfully, keyed by projectId. A project that fails to stage is absent.
const additionalSourceDirs: Record<string, string> = {};
// Each additional (referenced) project whose staging failed, paired with the
// failure message. Per-project failure isolation keeps the run and the other
// projects going; this list makes each failure a first-class, reported outcome.
const additionalSourceFailures: AdditionalSourceStagingFailure[] = [];
// Additional projects stage as plain trees. Drop the heavy build/cache dirs a
// reference tree does not need, and `.git` — additional sources never carry
// git-history semantics (anchor-only). Each project also drops its OWN
// resolved Git-ignored paths (or keeps this fixed set as-is for a non-Git
// source) — see `resolveReferencedSourceIgnore` and the per-project merge
// below.View on GitHub (pinned to 3f1d897a7c)