fix(copilot): upload sandbox-rendered bytes for docx/pptx/pdf creation#4636
fix(copilot): upload sandbox-rendered bytes for docx/pptx/pdf creation#4636TheodoreSpeaks wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Both Reviewed by Cursor Bugbot for commit d2074e4. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR fixes a bug where the
Confidence Score: 5/5Safe to merge — the change is a minimal, self-contained fix that correctly routes the sandbox-rendered binary Buffer to the upload call in both affected tools. Both files receive the same small structural change: capture the return value of runSandboxTask and gate the UTF-8 fallback to the else branch. The catch blocks return early in both files, so the uninitialized let is always assigned before use. No surrounding logic was changed, and the fix is consistent across the two call sites. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(copilot): upload sandbox-rendered by..." | Re-trigger Greptile |
Summary
workspace_file:createandedit_contentcalledrunSandboxTask('docx-generate' | 'pptx-generate' | 'pdf-generate', ...)but discarded the returnedBufferand uploadedBuffer.from(content, 'utf-8')instead — so.docx/.pptx/.pdffiles contained the model's source code (or whatever string it emitted) labeled with the correct binary MIME, causing "Failed to load file content" in the viewer and rejection by WordBufferand upload that; non-doc paths unchangedType of Change
Testing
Will test on staging.
bun run lintandbun run check:api-validation:strictclean;vitest run lib/copilot/tools/server/files/passes.Checklist