Summary
api/src/job.ts downloadAndWriteFile mounts a by-ref input at resolveOriginalName(response, file), which takes the file server's Content-Disposition (derived from original-filename metadata, always set by GET /sessions/:sid/objects/:id) and only falls back to the caller's file.name when the header is absent (main additionally yields when the header is an opaque <id><ext>). The control plane therefore cannot choose a destination that differs from the upload name.
LibreChat relies on exactly that: when two files in a conversation share a filename (an upload and the code output that rewrote it, or a re-upload under the original name), primeFiles sends the older one as <stem>-<hash><ext> (danny-avila/LibreChat#15449). Inside the sandbox both resolve to the bare name, reserveInputDestination throws Conflicting input destinations: <name> and <name>, and /exec returns 400 on every later turn of that conversation.
Reproduction
POST /exec with two files[] entries whose stored objects both carry original-filename: data.xlsx, sent as name: "data.xlsx" and name: "data-3f9a2c.xlsx". Observed: Error during execution: ValidationError: Conflicting input destinations: data.xlsx and data.xlsx. Expected: either the requested names are honoured, or the API documents that name is advisory so callers can avoid sending duplicates.
Notes
Summary
api/src/job.tsdownloadAndWriteFilemounts a by-ref input atresolveOriginalName(response, file), which takes the file server'sContent-Disposition(derived fromoriginal-filenamemetadata, always set byGET /sessions/:sid/objects/:id) and only falls back to the caller'sfile.namewhen the header is absent (mainadditionally yields when the header is an opaque<id><ext>). The control plane therefore cannot choose a destination that differs from the upload name.LibreChat relies on exactly that: when two files in a conversation share a filename (an upload and the code output that rewrote it, or a re-upload under the original name),
primeFilessends the older one as<stem>-<hash><ext>(danny-avila/LibreChat#15449). Inside the sandbox both resolve to the bare name,reserveInputDestinationthrowsConflicting input destinations: <name> and <name>, and/execreturns 400 on every later turn of that conversation.Reproduction
POST /execwith twofiles[]entries whose stored objects both carryoriginal-filename: data.xlsx, sent asname: "data.xlsx"andname: "data-3f9a2c.xlsx". Observed:Error during execution: ValidationError: Conflicting input destinations: data.xlsx and data.xlsx. Expected: either the requested names are honoured, or the API documents thatnameis advisory so callers can avoid sending duplicates.Notes