fix(files): allow document compiler to read referenced images - #6647
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview
Adds a regression test that asserts compilation receives the workspace principal and the update use case remains file-scoped. Reviewed by Cursor Bugbot for commit 2ea29cd. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR fixes document editing so compilation can read referenced images across the trusted workspace while retaining destination-file scoping for the resulting write.
Confidence Score: 5/5The PR appears safe to merge with workspace boundaries and destination-file write scoping preserved. The compiler now receives the workspace scope required to resolve referenced images, while existing authorization rejects files outside that workspace and the content update independently remains scoped to the intended destination file.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/copilot/tools/server/files/edit-content.ts | Separates workspace-scoped compilation reads from the existing file-scoped destination update without weakening workspace authorization. |
| apps/sim/lib/copilot/tools/server/files/edit-content.test.ts | Adds focused orchestration coverage confirming the compiler and destination write receive their intended authorization scopes. |
Sequence Diagram
sequenceDiagram
participant Copilot
participant Edit as edit_content
participant Compiler
participant Files as Workspace Files
participant Update as Content Update
Copilot->>Edit: Submit document source
Edit->>Compiler: Compile with workspace-scoped principal
Compiler->>Files: Read referenced workspace images
Files-->>Compiler: Authorized image content
Compiler-->>Edit: Compiled source MIME
Edit->>Update: Write using destination file scope
Update->>Files: Update canonical destination file
Reviews (1): Last reviewed commit: "fix(files): allow document compiler to r..." | Re-trigger Greptile
Summary
Type of Change
Testing
Focused tests, Biome, type-check, and strict API validation passed before shipping. No checks were rerun during ship.
Checklist