Conversation
Sg312
commented
May 14, 2026
- improvement(file-block): add get operation (improvement(file-block): add get operation #4588)
* File block get * Lint * Fix
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds a
Confidence Score: 4/5The change is a narrowly scoped read-only addition; all DB lookups are gated by workspaceId, so the access boundary is intact. The implementation is clean and consistent with the existing append/write patterns. The switch from discriminatedUnion to union in the contract schema silently degrades validation error messages for all three operations, and the get response exposes the internal storage identifier that other operations omit. apps/sim/lib/api/contracts/tools/file.ts and apps/sim/app/api/tools/file/manage/route.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Block as FileV3Block
participant Tool as file_get tool
participant API as /api/tools/file/manage
participant DB as workspace-file-manager
Block->>Tool: params with getFileInput or getFileId
Tool->>API: POST operation get with fileId or fileInput
API->>API: checkInternalAuth and validate
API->>DB: getWorkspaceFile(workspaceId, selectedFileId)
DB-->>API: WorkspaceFileRecord or null
alt file found
API-->>Tool: success with file metadata
Tool-->>Block: success output
else not found
API-->>Tool: 404 error
Tool-->>Block: failure output
end
Reviews (1): Last reviewed commit: "improvement(file-block): add get operati..." | Re-trigger Greptile |
* File block get * Lint * Fix * Fix auth
* fix(mothership): persist @-mentioned resources across send and merge on hydration * fix(mship-resources): handle ADD/DELETE race and reorder during pending flush - Track in-flight ADD promises so DELETE chains off finally(), preventing orphaned server rows when a user removes a resource before its POST resolves - Defer reorder PATCH until pending flush completes; emit with full local order - Clear new refs in reset paths * fix(mship-resources): defer reorder when ADDs are in-flight on existing chat reorderResources previously only checked pendingPersistResourceKeysRef. When a chatId exists, addResource fires the POST immediately and only tracks the promise in inFlightResourceAddsRef — so a reorder before those ADDs settle shipped a PATCH the server rejected, and the silent catch lost the reorder. Now treat in-flight ADDs like pending ones: defer the PATCH and replay it after Promise.allSettled on the in-flight map.
PR SummaryMedium Risk Overview Extends the File block/tooling with Refactors Reviewed by Cursor Bugbot for commit 1c111ff. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1c111ff. Configure here.
