feat: add direct sandbox workspace preview#7316
Draft
c121914yu wants to merge 2 commits into
Draft
Conversation
Coverage Report
File CoverageNo changed files found. |
|
✅ Admin Preview Image Ready! 🕒 Time: 2026-07-16 16:27:07 (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-16 16:31:32 (UTC+8) |
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 that escape the workspace root.sandbox_get_file_urlS3 uploads with direct workspace URLs so relative HTML assets continue to work.X-Sandbox-Ticket, document token redaction requirements, and keep the proxy origin separate from the FastGPT application origin.Why
The previous preview flow uploaded generated files to S3 and returned independent object URLs. That added storage work and made multi-file previews unreliable because relative assets such as CSS, JavaScript, and images no longer resolved against the sandbox workspace.
The proxy now treats the signed ticket as a time-limited read-only capability for the workspace and streams files directly from the running sandbox.
Impact and rollout
agent-sandbox-proxy, and the sandbox runtime image must be deployed together. Mixed-version rolling deployment is not supported./assets/app.jsremain unsupported; generated previews must use relative asset paths.Validation
pnpm --filter @fastgpt-sdk/sandbox-adapter test(226 passed, 55 skipped)pnpm --filter @fastgpt/service test(3,280 passed, 35 skipped)pnpm --filter @fastgpt/app typecheckpnpm --dir document exec fumadocs-mdxgit diff --check upstream/main...HEADupstream/main;git range-diffconfirms both feature commits are unchanged.