feat(studio): add opt-in dev-server proxy for platform /apis - #836
Merged
Conversation
Add VITE_PLATFORM_PROXY_DOMAIN to route same-origin /apis requests through the Vite dev server. When VITE_PLATFORM_BASE_URL is empty and the proxy domain is set, the browser only talks to the HTTPS dev server and Vite forwards to the plain-HTTP platform server-side. This avoids Safari's mixed-content block on an HTTPS (mkcert) page calling http://localhost. Document the new var in the sample env file. Signed-off-by: Alex Ray <alray@nvidia.com>
Contributor
📝 WalkthroughWalkthroughChangesPlatform API proxy
Sequence Diagram(s)sequenceDiagram
participant Browser
participant ViteDevServer
participant PlatformAPI
Browser->>ViteDevServer: Request /apis
ViteDevServer->>PlatformAPI: Proxy /apis
PlatformAPI-->>ViteDevServer: API response
ViteDevServer-->>Browser: API response
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@web/packages/studio/vite.config.ts`:
- Around line 207-217: Update the proxy configuration under shouldProxyPlatform
to remove secure: false, keeping TLS certificate verification enabled by default
for HTTPS targets while preserving the existing /apis proxy behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 144aa6cb-fa78-4cf4-a6a3-3419285abf8b
📒 Files selected for processing (2)
web/packages/studio/env/.env.dev.local.sampleweb/packages/studio/vite.config.ts
Contributor
|
dmariali
approved these changes
Jul 22, 2026
aray12
enabled auto-merge
July 22, 2026 18:38
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Jul 22, 2026
soluwalana
pushed a commit
that referenced
this pull request
Jul 22, 2026
Add VITE_PLATFORM_PROXY_DOMAIN to route same-origin /apis requests through the Vite dev server. When VITE_PLATFORM_BASE_URL is empty and the proxy domain is set, the browser only talks to the HTTPS dev server and Vite forwards to the plain-HTTP platform server-side. This avoids Safari's mixed-content block on an HTTPS (mkcert) page calling http://localhost. Document the new var in the sample env file. Signed-off-by: Alex Ray <alray@nvidia.com> Signed-off-by: Sam Oluwalana <soluwalana@nvidia.com>
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
Adds an opt-in Vite dev-server proxy so Studio can make same-origin
/apisrequests to the platform during local development.Introduces a new
VITE_PLATFORM_PROXY_DOMAINenv var. WhenVITE_PLATFORM_BASE_URLis set to an empty string andVITE_PLATFORM_PROXY_DOMAINis set,server.proxyforwards/apisto that domain. Otherwise the dev server config is unchanged.Why
The Studio dev server runs over HTTPS (via
vite-plugin-mkcert), but the local platform runs over plain HTTP (http://localhost:8080). An HTTPS page issuing HTTPfetches is active mixed content, which Safari/WebKit blocks hard (Chrome is more lenient). With this proxy, the browser only ever talks to the HTTPS dev origin and Vite forwards to the HTTP platform server-side — no mixed content, and HTTPS/mkcert stays intact.The entire platform request surface (SDK fetchers plus the non-SDK callers: data-designer preview, coding-agents, and deployment-log SSE) goes through
/apis, so a single proxy rule covers it. SSE works over the plain HTTP proxy; there are no native WebSockets to handle.How to use
In
env/.env.dev.local:Then restart the dev server. Leaving
VITE_PLATFORM_PROXY_DOMAINunset preserves today's behavior.Notes / out of scope
/telemetry(OTel) is intentionally not proxied; it's off by default locally (VITE_TELEMETRY_ENABLED=false).download_urls returned by the backend (e.g. evaluation results) are not affected by a path proxy — out of scope here.Test plan
pnpm --filter nemo-studio-ui typecheck/apiscalls succeed in Safari without mixed-content errorsVITE_PLATFORM_PROXY_DOMAINunset, confirm dev server behavior is unchangedSummary by CodeRabbit
/apisrequests.