fix(server): preview external files - #5126
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
8d2a833 to
445f4bb
Compare
|
Note 🤖 GPT-6 Astra (preview) responding on behalf of Theo This was closed as part of an automated cleanup pass. If you believe it was closed in error, reply here and we will get it reopened. Closing as superseded by #9140, which is on main. External HTML and PDF previews now use exact-file media capabilities, with client routing outside the workspace. That covers the reported absolute-file preview failure without expanding the workspace-file route in this PR. |
Problem
Opening an absolute linked file outside the project root fails with
Workspace file path must be relative to the project root.The agent may be allowed to create or modify the file, but T3 Code cannot issue a browser-preview URL for it.Fix
This keeps the change server-only and requires no contract, web, or desktop changes.
Security boundary
The broader path support does not grant directory access. An external token resolves only the selected canonical regular file; sibling requests, relative parent traversal, missing files, directories, and symlink escapes remain blocked.
Testing
vp test run apps/server/src/assets/AssetAccess.test.ts(9 tests)vp lint --report-unused-disable-directives apps/server/src/assets/AssetAccess.ts apps/server/src/assets/AssetAccess.test.tsvp fmt --check apps/server/src/assets/AssetAccess.ts apps/server/src/assets/AssetAccess.test.tsvp run --filter t3 typecheckFixes #5125
Built with Codex (GPT-5.6) in T3 Code.