Skip to content

fix: mount new inputs before replaying programmatic calls - #371

Draft
JamieStivala wants to merge 1 commit into
LibreChat-AI:mainfrom
jaworldwideorg:fixes/upstream-ptc-continuation-files
Draft

JamieStivala wants to merge 1 commit into
LibreChat-AI:mainfrom
jaworldwideorg:fixes/upstream-ptc-continuation-files

Conversation

@JamieStivala

@JamieStivala JamieStivala commented Oct 26, 2026 •

Copy link
Copy Markdown

Problem and change

A programmatic script may pause for an MCP download after execution has started. The newly uploaded file is not in the initial input set, and current continuations carry only tool results, so the script cannot open the download after the tool returns.

Pending replay responses now advertise continuation_files: 1. Each issued tool result can include owned input references using the existing reference schema. Under the execution lock, the API validates ownership and limits, rejects filename replacement, and commits the additive file set together with immutable history before replay. The next sandbox iteration mounts the inputs before resuming user code. Identical retries remain idempotent. Blocking mode rejects the unsupported capability explicitly.

Fixes #370. Related host report: LibreChat-AI/LibreChat#17092. Coordinated SDK counterpart: LibreChat-AI/agents#645. The focused branch excludes JA Docker packaging, registry scopes, and CI/CD changes.

Verification

  • PR branch TypeScript and 38 file-reference/authorization tests passed.
  • The coordinated integration build passed its Linux full-suite and replay CI gate before image publication.
  • Real local Code API/NsJail, multipart upload, synthetic PDF/DOCX and Python/Bash same-script byte reads were exercised. Live probes reject unissued calls, unauthorized references and traversal.
  • An authenticated deployment smoke test verified PDF byte hash/page count through a continuation and deleted its synthetic input.
  • Blocking-mode mounts, Lambda MicroVM/OBO and remote-bridge delivery are not claimed as supported.

The two narrow typing fixes outside replay preserve existing behavior and allow strict typechecking of legacy-field compatibility code.

References: MCP embedded tool resources, the continuation contract added in docs/MCP_CONTINUATION_FILES.md, and the repository's existing file-reference authorization boundary.

This is my first contribution to this repository, so any feedback is appreciated :) AI assistance was used; reproduction and verification limits are documented above.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accept newly downloaded input files on replay continuations

2 participants