Skip to content

Report files dropped from /exec files[] by output limits (count, depth, size, path) #198

Description

@danny-avila

Problem

/exec can drop generated files from files[] with no marker in the response. The client can't tell "not generated" from "generated but dropped". artifact_delivery covers upload failures only (api/v2.ts, delivery.ts). These limits in api/src/job.ts skip files without it:

  • Output file count: SANDBOX_MAX_OUTPUT_FILES (default 50) stops the scan once it's reached. Inherited refs only fill the slots left over.
  • Nesting depth: directories at max_nesting_depth (default 10) or deeper are skipped.
  • Path shape / length: paths failing isValidPathShape (max_path_length 256) are skipped.
  • File size: files over SANDBOX_MAX_FILE_SIZE (default 10 MB) are skipped.
  • Unreadable files: a failed stat skips the file.

An internal truncated status exists, but it never reaches the response.

Impact

LibreChat's create_file and the other sandbox authoring writes report success unless artifact_delivery is set (LibreChat-AI/LibreChat#15920, LibreChat-AI/LibreChat#15671). A file dropped by one of these limits is reported as written, but it isn't persisted for later calls or downloads.

Proposal

When the scan skips a file that would otherwise be returned, say so in the response. Either extend artifact_delivery, or add a sibling marker such as { code: 'artifact_truncated', reasons: { max_files, depth, size, path, unreadable }, skipped }. Ideally include the skipped relative paths, capped, so a client can match its own write against them.

Out of scope, since these are intentional and not failures:

  • unsupported extensions
  • hidden directories
  • unchanged files that session-mode content-hash dedup leaves out

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