[q] Fix upload-assets not processing files from MCP server #7293
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.
Problem
The
upload_assets.cjsscript was not processing asset files uploaded via the safe-outputs MCP server, causing them to be saved to artifacts but never published to the orphaned git branch.Root Cause
The script filters for both types of upload items:
upload_assets(plural - legacy type)upload_asset(singular - modern MCP server type)It correctly combines them into
allUploadItems:However, the loops at lines 124 and 182 were still iterating over
uploadAssetItemsinstead ofallUploadItems:This meant that when AI agents used the modern MCP server tool (which creates
upload_assetentries), the files would:Solution
Changed both loops to iterate over
allUploadItemsinstead ofuploadAssetItems:This ensures both legacy and modern upload types are processed correctly.
Testing
The existing test file
pkg/workflow/js/upload_assets.test.cjsalready uses the modernupload_assettype in its test cases, confirming this is the expected format.Impact
Before: AI agents using the
upload assettool from safe-outputs MCP would see success messages but images would never be published to the git branch.After: All uploaded assets are correctly published to the orphaned branch and accessible via raw.githubusercontent.com URLs.
Fixes #7290