Repository navigation
mcp: author_scene payload by reference (payloadFile) - #1194
Merged
Merged
Conversation
A house payload runs past what one call carries. Upload it as a JSON project file and pass its fileId as payloadFile; the host lends a ProjectFileReader to read it. Paint's texture url names artifact:// images stored with the project. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
author_scenetakespayloadFile: thefileIdof a JSON project file (fromupload_project_file) holding the payload. It's for a payload too large for one call, like a whole house with its modules. The server reads it through a new host hook,ProjectFileReader(readFileoncreatePascalMcpServer). After that it is handled exactly like an inline payload: it is stored, soreplace: truewrites it again.payload_invalidwith the issue paths;payloadtogether withpayloadFileanswerspayload_twice;edits_with_payload;files_unavailable.urldescription now says it can beartifact://<sha256>of an image stored with the project.pascal-3dskill and the tool description tell agents to usepayloadFilefor large payloads.How to test
cd packages/mcp && bun test src/tools/author-scene-sources.test.ts: the new case writes a house from a file, writes it again withreplace: true, and checks the four refusals.cd packages/core && bun test src/agent-tools src/contracts: the contract purity and notation tests pass with the new input.bun run skills:validate.Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
Extends the destructive
author_sceneconversion path with hosted file reads, though size limits and schema checks mirror the inline payload path.Overview
author_scenecan takepayloadFile(afileIdfromupload_project_file) instead of an inlinepayload, so large conversion JSON (e.g. a whole house with embedded modules) does not have to fit in one MCP call. The hosted server reads bytes through a new optionalreadFile/ProjectFileReaderhook oncreatePascalMcpServer; after load, behavior matches an inline payload (including storage andreplace: truerewrites).New guardrails:
payload+payloadFile→payload_twice;editswith either →edits_with_payload; no reader →files_unavailable; bad/missing file →payload_invalidorfile_request_failed. Reads are capped at 32 MiB. Adapter/file payload validation is shared via aparsedPayloadhelper.Docs only elsewhere:
painttextureurlmay useartifact://<sha256>;pascal-3dskill/workflow text describes the upload +payloadFilepath. MCP tests cover happy path,replace: true, and refusals.Reviewed by Cursor Bugbot for commit 6e51b85. Bugbot is set up for automated code reviews on this repo. Configure here.