mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-10-19 09:13:28 +00:00
fix(interactive): remove dead --beta sandbox injection code
Commit 18bbe3e9 promoted sandbox to a first-class cloud, removing it
from the --beta gate. The selectCloud() function in interactive.ts still
had ~30 lines of dead code injecting a "local-sandbox" synthetic option
(sandboxEnabled is always false post-promotion). Remove the dead block
and simplify selectCloud().
Bump CLI to 1.1.1.
Agent: code-health
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
18bbe3e9a5
commit
0efa64752f
2 changed files with 1 additions and 28 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@openrouter/spawn",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"type": "module",
|
||||
"bin": {
|
||||
"spawn": "cli.js"
|
||||
|
|
|
|||
|
|
@ -81,31 +81,13 @@ function getAndValidateCloudChoices(
|
|||
}
|
||||
|
||||
// Prompt user to select a cloud with arrow-key navigation.
|
||||
// When --beta sandbox is active and "local" is in the list, injects a
|
||||
// "Local Machine (Sandboxed)" option right after "Local Machine".
|
||||
async function selectCloud(
|
||||
manifest: Manifest,
|
||||
cloudList: string[],
|
||||
hintOverrides: Record<string, string>,
|
||||
): Promise<string> {
|
||||
const betaFeatures = (process.env.SPAWN_BETA ?? "").split(",");
|
||||
const sandboxEnabled = betaFeatures.includes("sandbox");
|
||||
|
||||
const options = mapToSelectOptions(cloudList, manifest.clouds, hintOverrides);
|
||||
|
||||
// Inject sandbox option next to "local" when --beta sandbox is set
|
||||
if (sandboxEnabled && cloudList.includes("local")) {
|
||||
const localIdx = options.findIndex((o) => o.value === "local");
|
||||
if (localIdx !== -1) {
|
||||
options[localIdx].hint = "No isolation — runs on your machine";
|
||||
options.splice(localIdx + 1, 0, {
|
||||
value: "local-sandbox",
|
||||
label: "Local Machine (Sandboxed)",
|
||||
hint: "Runs in a Docker container",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Add "Link Existing Server" option at the bottom for BYOS workflow
|
||||
options.push({
|
||||
value: "link-existing",
|
||||
|
|
@ -122,15 +104,6 @@ async function selectCloud(
|
|||
handleCancel();
|
||||
}
|
||||
|
||||
// Map synthetic "local-sandbox" back to "local" and ensure sandbox beta is set
|
||||
if (cloudChoice === "local-sandbox") {
|
||||
const existing = process.env.SPAWN_BETA ?? "";
|
||||
if (!existing.split(",").includes("sandbox")) {
|
||||
process.env.SPAWN_BETA = existing ? `${existing},sandbox` : "sandbox";
|
||||
}
|
||||
return "local";
|
||||
}
|
||||
|
||||
return cloudChoice;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue