[q] Fix upload-assets not processing files from MCP server#7293
Merged
[q] Fix upload-assets not processing files from MCP server#7293
Conversation
The upload_assets.cjs script was filtering for both 'upload_assets' and 'upload_asset' types and combining them into allUploadItems, but then only iterating over uploadAssetItems (the legacy singular type). This caused files uploaded via the modern MCP server (which uses 'upload_asset' type) to be saved to artifacts but never published to the orphaned git branch. Fixed by changing both loops to iterate over allUploadItems instead of uploadAssetItems, ensuring both legacy and modern upload types are processed correctly. Fixes #7290
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.
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