feat: add direct sandbox workspace preview#7316
Open
c121914yu wants to merge 8 commits into
Open
Conversation
Coverage Report
File CoverageNo changed files found. |
|
✅ Admin Preview Image Ready! 🕒 Time: 2026-07-20 22:18:02 (UTC+8) |
|
✅ Docs Preview Deployed! 🔗 👀 Click here to visit preview 🕒 Time: 2026-07-16 16:27:22 (UTC+8) |
|
✅ Build Successful - Preview fastgpt Image for this PR: 🕒 Time: 2026-07-20 22:19:34 (UTC+8) |
c121914yu
force-pushed
the
feat-sandbox-preview
branch
from
July 20, 2026 12:54
cd49829 to
b18bee0
Compare
c121914yu
marked this pull request as ready for review
July 20, 2026 13:18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
fastgpt-ide-agentand expose it throughagent-sandbox-proxyat/preview/{token}/{path}.GET,HEAD, ETag, content length/type, and single byte ranges while rejecting traversal and symlinks escaping the workspace.sandbox_get_file_urlS3 uploads with direct workspace URLs so relative CSS, JavaScript, and image assets work.X-Sandbox-Ticketand keep preview content on the proxy origin.AGENT_SANDBOX_PREVIEW_PROXY_URL; optionally use an independentPREVIEW_PORT.Why
The previous flow copied generated files to S3. This added storage work and broke multi-file previews because relative assets no longer resolved against the sandbox workspace.
The new flow treats the signed preview ticket as a two-hour, read-only workspace capability and streams files directly from the running sandbox.
Impact and rollout
/assets/app.jsare unsupported; generated previews must use relative paths.ws(s)://andhttp(s)://URL settings. A second listener is enabled only by explicitly settingPREVIEW_PORT.agent-sandbox-proxy, and the sandbox runtime image must be deployed compatibly.Validation
linux/arm64.git diff --check