fix(copilot): surface document render failures - #6629
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview
Tests cover the VFS handler boundary and Reviewed by Cursor Bugbot for commit 3ad89f2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe PR changes document-render failures from successful VFS responses containing error JSON into failed tool calls, while retaining workspace-file provenance validation before detailed errors are returned.
Confidence Score: 5/5The PR appears safe to merge. The previously reported provenance bypass is fixed: render failures associated with resolved workspace files retain their identity and undergo provenance validation before the detailed error is returned, with a generic safe failure used when validation fails.
|
| Filename | Overview |
|---|---|
| apps/sim/lib/copilot/tools/handlers/vfs.ts | Converts dynamic-read errors into failed tool calls only after the existing provenance check. |
| apps/sim/lib/copilot/vfs/workspace-vfs.ts | Preserves render exceptions in the VFS result and binds file identity whenever rendering reached a resolved workspace file. |
| apps/sim/lib/copilot/vfs/file-reader.ts | Extends the internal read-result contract with an optional dynamic-view error. |
| apps/sim/lib/copilot/tools/handlers/vfs.test.ts | Covers failed-tool-call signaling and generic-error fallback when provenance verification fails. |
| apps/sim/lib/copilot/vfs/workspace-vfs.test.ts | Covers conversion of renderer exceptions into explicit VFS read errors. |
Sequence Diagram
sequenceDiagram
participant Agent as File Agent
participant Handler as executeVfsRead
participant VFS as WorkspaceVFS
participant Renderer as Document Renderer
participant Provenance as Provenance Gate
Agent->>Handler: vfs_read(/render)
Handler->>VFS: readFileContentWithProvenance
VFS->>Renderer: render document
Renderer-->>VFS: throw render error
VFS-->>Handler: bound file identity + error result
Handler->>Provenance: validate derived model view
alt provenance accepted
Provenance-->>Handler: allowed
Handler-->>Agent: failed tool call with render error
else provenance unavailable
Provenance-->>Handler: denied
Handler-->>Agent: failed tool call with generic safe error
end
Reviews (2): Last reviewed commit: "Address PR review feedback (#6629)" | Re-trigger Greptile
- validate render errors against workspace-file provenance before returning details\n- cover blocked provenance with a regression test
Addressed in b893927: detailed render errors now pass the existing workspace-file provenance gate before reaching the model, and a regression test covers provenance-blocked error envelopes. |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort 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 b893927. Configure here.
- mark every non-throwing render failure as a failed dynamic read\n- cover all soft render failure paths with producer-level tests\n\nNote: pre-existing type-check failures in HEIC and provider files are not addressed by this PR.

Summary
When document rendering fails, the file agent now receives a failed
vfs_readtool call with the real compiler or renderer error. Previously, the VFS returned that failure as successful JSON content, so the agent could continue without a rendered reference and misdiagnose the problem.The error remains inside the existing provenance envelope, so this hardening does not bypass workspace-file access or secret checks.
Type of Change
Testing
bun run check:api-validationpassed.Reviewer focus: verify that a
/renderexception stays provenance-aware while crossing the VFS boundary as a failed tool call.Checklist
Screenshots/Videos
Not applicable; this changes backend tool error signaling.