Skip to content

feat(cli): expand fast_provision experiment to images + docker + sandbox#3398

Draft
AhmedTMM wants to merge 1 commit intoOpenRouterTeam:mainfrom
AhmedTMM:feat/restore-feature-flags
Draft

feat(cli): expand fast_provision experiment to images + docker + sandbox#3398
AhmedTMM wants to merge 1 commit intoOpenRouterTeam:mainfrom
AhmedTMM:feat/restore-feature-flags

Conversation

@AhmedTMM
Copy link
Copy Markdown
Collaborator

@AhmedTMM AhmedTMM commented May 8, 2026

Summary

The PostHog `fast_provision` flag is already wired via `shared/feature-flags.ts` and currently bundles `images` for the `test` variant. This PR expands the test variant to the full provisioning-speed stack:

  • images — pre-built DO marketplace images (cloud-side faster boot)
  • docker — Docker CE host image on Hetzner/GCP (cloud-side faster boot)
  • sandbox — local agents run in a Docker container (local-side faster boot)

Users who explicitly pass `--beta` or `--fast` still take precedence and skip the experiment bucket. `$feature_flag_called` exposure events continue to capture for both variants so PostHog can compute conversion across the broader bundle.

Heads-up: known sandbox gap

`pullAndStartContainer` in `packages/cli/src/local/local.ts:533` runs `docker run` with no volume mount. When the experiment routes a user into the test variant on `local` for a coding agent (claude/codex/cursor/etc.), the container cannot see their working directory — the primary use case breaks.

Two options before flipping the flag on at PostHog:

  1. Recommended — add `-v "$(pwd)":/workspace -w /workspace` to `pullAndStartContainer` for coding agents. One-liner, makes sandbox actually usable.
  2. Alternative — exclude coding agents from the sandbox variant; keep it limited to openclaw/hermes where containerization without mount is fine.

Either way, this PR ships the bundle change cleanly; the volume-mount fix is small enough to land separately or as a follow-up commit on this branch — your call.

Test plan

  • `bun test src/tests/feature-flags.test.ts` — 11/11 pass
  • `bunx @biomejs/biome check src/` — clean
  • Smoke test: `SPAWN_FEATURE_FLAGS_DISABLED=1 spawn claude local` (control path) → behaves as today
  • Smoke test: force test variant, verify `SPAWN_BETA=images,docker,sandbox`
  • Decide on volume-mount before flipping flag at PostHog

🤖 Generated with Claude Code

Builds on the existing PostHog `fast_provision` flag (already wired via
shared/feature-flags.ts). The `test` variant now bundles the full
provisioning-speed stack rather than images alone:

  - images:  pre-built DO marketplace images (cloud-side faster boot)
  - docker:  Docker CE host image on Hetzner/GCP (cloud-side faster boot)
  - sandbox: local agents run in a Docker container (local-side faster boot)

Users who explicitly pass --beta or --fast still take precedence and skip
the experiment bucket. Exposure events are still captured for both
variants so PostHog can compute conversion across the broader bundle.

Bumps CLI to 1.0.39.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant