fabro/apps/fabro-web/app/components
Bryan Helmkamp e18772888e
Model run sandbox lifecycle explicitly (#431)
## Summary

Fixes sandbox state reporting by separating a requested sandbox plan
from an initialized sandbox instance. Runs now project sandbox lifecycle
as `planned`, `initializing`, `ready`, or `failed`, and live sandbox
operations only proceed once a real instance exists.

## Changes

- Introduces `RunSandboxPlan`, `RunSandboxInstance`, and
lifecycle-backed `RunSandbox` domain types, with serde validation that
prevents `ready` sandboxes without an instance.
- Updates store projection behavior so sandbox events transition through
planned, initializing, ready, and failed states while preserving
requested provider/image/snapshot separately from runtime metadata.
- Tightens server sandbox handlers so
details/files/services/terminal/VNC helpers require an initialized
instance and return a clear 404 when the sandbox was never created.
- Updates the OpenAPI contract and regenerated clients so `Run.sandbox`
exposes lifecycle state while `SandboxDetails.sandbox` contains only
initialized instance metadata.
- Updates the web UI to render lifecycle state directly from run
summaries, hide the Sandbox tab for pure planned sandboxes, and disable
sandbox controls until the instance is ready.
- Cleans up duplicated lifecycle display/type logic and duplicate
server-side sandbox instance loading found during review.

| Lifecycle state | Meaning | Live controls |
| --- | --- | --- |
| `planned` | Sandbox was requested but no provider instance exists |
Hidden/disabled |
| `initializing` | Provider setup has started | State view only |
| `ready` | Runtime instance exists | Enabled |
| `failed` | Provider setup failed with error details | State view only
|

## Testing

- `cargo check --workspace`
- `cargo +nightly-2026-04-14 fmt --check --all`
- `git diff --check`
- `cd apps/fabro-web && bun run typecheck`
- `cd apps/fabro-web && bun test app/routes/run-detail.test.ts
app/routes/run-sandbox.test.tsx
app/components/run-summary-panel.test.tsx`
- `cargo nextest run -p fabro-types --test sandbox_model_serde`
- `cargo nextest run -p fabro-store
run_created_projects_planned_sandbox_lifecycle
sandbox_lifecycle_events_update_projected_sandbox_state
run_failed_before_sandbox_events_leaves_sandbox_planned`
- `cargo nextest run -p fabro-server
planned_sandbox_returns_404_from_details_endpoint
planned_sandbox_rejects_live_operations
failed_sandbox_rejects_live_operations
local_sandbox_returns_provider_neutral_details`
- `cargo nextest run -p fabro-api --test run_sandbox_round_trip`
- `cargo nextest run -p fabro-api --test sandbox_details_round_trip`

---

[![Compound
Engineering](https://img.shields.io/badge/Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)
🤖 Generated with GPT-5 via [Codex](https://openai.com/codex)
2026-05-27 12:48:56 -04:00
..
chats Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
runs-list Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
stage-renderers refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
auth-layout.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
collapsible-file.tsx refactor(web): drop light mode, go dark-only 2026-04-20 09:27:08 -04:00
editable-run-title.test.tsx feat(web): inline-edit run titles in the run header 2026-05-09 11:54:41 -04:00
editable-run-title.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
event-debug-helpers.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
event-debug.tsx Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
floating-tooltip.tsx Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
graph-toolbar-constants.ts refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
graph-toolbar.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
icons.tsx feat(runs): link stored pull requests 2026-05-08 13:17:08 -07:00
inline-markdown.test.tsx feat(web): render inline Markdown in run titles 2026-05-08 18:30:51 -07:00
inline-markdown.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
interview-dock.test.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
interview-dock.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
interview-label.ts refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
pull-request-chip.test.tsx feat(pr): support GitHub pull request associations (#270) 2026-05-16 12:47:27 -04:00
pull-request-chip.tsx feat(pr): support GitHub pull request associations (#270) 2026-05-16 12:47:27 -04:00
run-summary-panel.test.tsx Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
run-summary-panel.tsx Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
run-waterfall.tsx Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
settings-panel.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
size-chip.tsx feat(web): add sortable Size column to runs list 2026-05-25 14:07:17 -04:00
stage-context.tsx feat(web): add Context tab to the stage detail view (#340) 2026-05-21 20:19:55 -04:00
stage-insights-sidebar.test.tsx refactor: rationalize server secret scopes (vault-only for optional int… (#401) 2026-05-25 17:26:01 -04:00
stage-insights-sidebar.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
stage-popover-summary.ts refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
stage-popover.test.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
stage-popover.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
stage-sidebar.test.tsx Surface reasoning_effort + speed in stage badge end-to-end (#363) 2026-05-23 13:14:55 -04:00
stage-sidebar.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
state.tsx feat(web): add "Test models" sweep button on settings/models (#410) 2026-05-25 22:42:16 -04:00
steer-bar.tsx refactor(web): improve React Doctor score (#405) 2026-05-25 22:41:37 -04:00
terminal-view-helpers.ts Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
terminal-view.test.ts Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
terminal-view.tsx Model run sandbox lifecycle explicitly (#431) 2026-05-27 12:48:56 -04:00
toast.test.tsx Introduce approved effect hooks and migrate direct useEffect calls (#425) 2026-05-27 10:37:29 -04:00
toast.tsx Replace DIY overlay primitives with Radix UI + Sonner (#424) 2026-05-26 23:03:06 -04:00
ui.tsx Replace DIY overlay primitives with Radix UI + Sonner (#424) 2026-05-26 23:03:06 -04:00