fix(web): honest sandbox picker + hide local-only permission options - #5302
Conversation
…mission options Claude-Session: https://claude.ai/code/session_01XhENr63WL9npkKrJGnzDc1
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization 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:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
🌙 Overnight — ready for review + live-QA'd. Makes the sandbox picker honest: it shows only the providers the deployment enabled (new |
Problem
The playground's "Execution environment" advanced panel was dishonest about what a deployment actually supports:
isSandboxLocalEnabled) that could droplocal, but nothing restricted the picker to the enabled set. If the schema enum listeddaytona, the picker offered it even when the deployment enabled onlylocal(or vice-versa). The runtime already knew the full provider list fromAGENTA_RUNNER_ENABLED_SANDBOX_PROVIDERS; it just collapsed it to a boolean.SandboxPermissionControlknobs (network egress, allowlist, filesystem, enforcement) rendered whenever the schema exposedsandbox.permissions, regardless of the selected provider. Those boundaries are only meaningful for a real isolating provider (daytona); thelocalsandbox is the runner host and does not enforce them, so showing them forlocalis misleading.Change
Honest picker (concern #1). Expose the full enabled-provider set to the frontend and filter the picker to it.
web/entrypoint.shderives and injectsNEXT_PUBLIC_AGENTA_ENABLED_SANDBOX_PROVIDERS(normalized lowercase, whitespace-free comma list) alongside the existing boolean derivation.processEnvmaps (dynamicEnv.ts,agenta-shared/api/env.ts).getEnabledSandboxProviders()helper next toisSandboxLocalEnabled(): splits the var, trims/lowercases, drops empties, and defaults to["local"]when unset/empty so the picker never hides every option.useModelHarness.tsxfilters the picker options to the enabled set:getEnumOptions(...).filter(o => enabled.has(o.value)).Hide local-only permission options (concern #2). Gate the
SandboxPermissionControlblock on the selectedsandbox.kind !== "local". Forlocalthe egress/permission block is hidden; fordaytonait still shows.Before / After
local+daytonaregardless of what the deployment enabled; permission knobs show forlocaleven though they are not enforced there.["local"]fallback if the var is unset); permission knobs are hidden when the selected provider islocal.Verification
pnpm --filter @agenta/shared types:checkandpnpm --filter @agenta/entity-ui types:check— clean.Note:
web/{oss,ee}/public/__env.jsare gitignored local dev artifacts, so they are not part of this diff; the tracked source of truth is the twoprocessEnvmaps plusentrypoint.sh.https://claude.ai/code/session_01XhENr63WL9npkKrJGnzDc1