Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "1.0.23",
"version": "1.0.24",
"type": "module",
"bin": {
"spawn": "cli.js"
Expand Down
228 changes: 0 additions & 228 deletions packages/cli/src/__tests__/feature-flags.test.ts

This file was deleted.

48 changes: 0 additions & 48 deletions packages/cli/src/__tests__/install-id.test.ts

This file was deleted.

23 changes: 0 additions & 23 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ import {
} from "./commands/index.js";
import { expandEqualsFlags, findUnknownFlag } from "./flags.js";
import { agentKeys, cloudKeys, getCacheAge, loadManifest } from "./manifest.js";
import { getFeatureFlag, initFeatureFlags } from "./shared/feature-flags.js";
import { getInstallRefPath } from "./shared/paths.js";
import { asyncTryCatch, asyncTryCatchIf, isFileError, isNetworkError, tryCatch, tryCatchIf } from "./shared/result.js";
import { captureError, initTelemetry, setTelemetryContext } from "./shared/telemetry.js";
Expand Down Expand Up @@ -849,8 +848,6 @@ async function main(): Promise<void> {
// ── `spawn pick` — bypass all flag parsing; used by bash scripts ──────────
// Must be handled before expandEqualsFlags / resolvePrompt so that pick's
// own --prompt flag is not mistakenly consumed by the top-level prompt logic.
// Runs before initFeatureFlags() — this is a hot path called by shell
// scripts and must stay fast; it has no code paths that gate on a flag.
if (rawArgs[0] === "pick") {
const pickResult = await asyncTryCatch(() => cmdPick(expandEqualsFlags(rawArgs.slice(1))));
if (!pickResult.ok) {
Expand All @@ -860,18 +857,11 @@ async function main(): Promise<void> {
}

// ── `spawn feedback` — bypass flag parsing; rest of args are the message ───
// Also runs before initFeatureFlags() for the same reason as `pick`.
if (rawArgs[0] === "feedback") {
await cmdFeedback(rawArgs.slice(1));
return;
}

// Fetch feature flags (1.5s timeout, fail-open). Must run before any code
// path that gates on a flag — currently the SPAWN_BETA composition for the
// `fast_provision` experiment. Placed AFTER the pick/feedback bypasses so
// those fast paths never pay the flag-fetch cost.
await initFeatureFlags();

const args = expandEqualsFlags(rawArgs);

// Pre-scan for --output json before checkForUpdates() so install script
Expand Down Expand Up @@ -937,7 +927,6 @@ async function main(): Promise<void> {
"skills",
]);
const betaFeatures = extractAllFlagValues(filteredArgs, "--beta", "spawn <agent> <cloud> --beta parallel");
const userOptedIntoBeta = betaFeatures.length > 0 || process.env.SPAWN_FAST === "1";
for (const flag of betaFeatures) {
if (!VALID_BETA_FEATURES.has(flag)) {
console.error(pc.red(`Unknown beta feature: ${pc.bold(flag)}`));
Expand All @@ -956,18 +945,6 @@ async function main(): Promise<void> {
if (process.env.SPAWN_FAST === "1") {
betaFeatures.push("tarball", "images", "parallel", "docker");
}

// fast_provision experiment: if the user did NOT pass --beta or --fast,
// bucket them on the PostHog `fast_provision` flag. The `test` variant
// turns on tarball + images by default; control behaves as before.
// Exposure is captured for both variants so PostHog can compute conversion.
if (!userOptedIntoBeta) {
const variant = getFeatureFlag("fast_provision", "control");
if (variant === "test") {
betaFeatures.push("tarball", "images");
}
}

if (betaFeatures.length > 0) {
process.env.SPAWN_BETA = [
...new Set(betaFeatures),
Expand Down
Loading
Loading