Problem
upload-workitem-attachment does not stage files during Stage 1 (MCP). The executor reads directly from source_directory at Stage 3, but the sandbox workspace may no longer be accessible by then. This is inconsistent with the staging pattern used by upload-build-artifact and create-pull-request.
Proposed Fix
- Add file staging in the MCP handler: copy the file to
output_directory with a generated filename (matching the pattern in upload-build-artifact)
- Add
staged_file, file_size, and staged_sha256 fields to UploadWorkitemAttachmentResult
- Update the executor to read from
ctx.working_directory.join(staged_file) instead of ctx.source_directory.join(file_path)
- Add SHA-256 cross-stage integrity verification (matching
upload-build-artifact)
- Add a Stage 1 size cap using the default max file size
See PR #380 for the staging pattern reference.
Problem
upload-workitem-attachmentdoes not stage files during Stage 1 (MCP). The executor reads directly fromsource_directoryat Stage 3, but the sandbox workspace may no longer be accessible by then. This is inconsistent with the staging pattern used byupload-build-artifactandcreate-pull-request.Proposed Fix
output_directorywith a generated filename (matching the pattern inupload-build-artifact)staged_file,file_size, andstaged_sha256fields toUploadWorkitemAttachmentResultctx.working_directory.join(staged_file)instead ofctx.source_directory.join(file_path)upload-build-artifact)See PR #380 for the staging pattern reference.