Skip to content

run_python: stage_files rejects >20 files (hardcoded quota, no setting) #2352

Description

@z1ppeh

Which version of LM Studio?
LM Studio 1.1.1 — Bionic agent (affects the run_python tool)

Which operating system?
Windows 11 Pro

What is the bug?
stage_files is hard-limited to 20 entries per call, with no option to increase it. The limit is not documented anywhere in the tool description, which says stage_files "copies host files into the exact /inputs/... paths" with no count cap mentioned.

Logs

json
{
"error": {
"message": "Too many input files. Limit: 20.",
"name": "PythonInputError"
},
"inputs": [],
"outputs": [],
"run_id": "6d12c51e-8263-4146-9b78-39c9225273af",
"status": "error",
"stderr": "",
"stdout": ""
}
To Reproduce

Create 21 small text files in the scratchpad folder.
Call run_python with all 21 files listed in stage_files.
The call is rejected before Python executes (empty stdout/stderr) with PythonInputError: "Too many input files. Limit: 20."
Expected behavior
All 21 files staged into /inputs/, or a documented/adjustable limit.

Actual behavior
Hard rejection at >20 files. Verified boundary: 20 files ✅ succeed (including moving them between folders inside the sandbox), 21 files ❌ rejected, 40 files ❌ rejected.

Technical notes (from the installed bundle, resources/app/.webpack-bionic/main/index.js)

The limit is a hardcoded default: defaultPythonRunnerQuotas = { maxInputFiles: 20, maxInputBytes: 100 MiB, maxInputFileBytes: 100 MiB, maxOutputFiles: 100, maxOutputBytes: 100 MiB, maxStdoutBytes: 64 KiB, maxStderrBytes: 64 KiB, defaultTimeoutMs: 60000, maxTimeoutMs: 120000 }.
PythonRunnerProvider already merges overrides over these defaults (this.quotas = { ...defaultPythonRunnerQuotas, ...options.quotas ?? {} }), but no code path passes quotas from user settings — the override hook is currently dead code.
No setting, env var, or docs page exposes or mentions any of these quotas.
Suggestion

Expose the quotas as a setting (or env var) — the options.quotas merge already exists, so this is a small change.
At minimum, document the limit in the tool schema/description, along with the existing workarounds: batching ≤20 files per call, chaining runs (/outputs of one call is copied back to the scratchpad and can be re-staged by the next), or zipping files into a single archive to stage as one file.

Side note: This already prompted a workaround skill (zip → stage one archive → extract in-sandbox). For ~8+ files that pattern also saves tokens (~75/file of staging plumbing vs a fixed ~650 for the zip), so the cap is pushing users toward a workaround that's both necessary and more efficient — a further reason to raise or document the limit.

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