Skip to content

Sandbox ignores the requested files[].name when the stored object carries an original filename #175

Description

@jomspk

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions