Skip to content

fix(ui): better sandbox_unavailable error + SANDBOX.md operator guide - #87

Merged
khoks merged 2 commits into
mainfrom
chore/sandbox-error-message-and-docs
May 18, 2026
Merged

khoks merged 2 commits into
mainfrom
chore/sandbox-error-message-and-docs

Conversation

@khoks

@khoks khoks commented May 18, 2026

Copy link
Copy Markdown
Owner

Summary

A user just hit STORY-065 (Piston broken on Docker Desktop Windows) from the live UI — pressed Run, got:

```
Run failed
sandbox_unavailable — Piston execute failed
```

…with no path forward. Two fixes:

  1. In-app: RunResultPanel (both /session and /playground) now appends a coach-voice line + link to docs/operations/SANDBOX.md when error === 'sandbox_unavailable'. Original error string still rendered for power users.

  2. Docs: new docs/operations/SANDBOX.md with the four real fix paths:

    • A — WSL-native docker engine inside a user Ubuntu distro (recommended; preserves self-host promise)
    • B — remote Piston on a Linux VM via PISTON_URL
    • C — public Piston API — RULED OUT (whitelist-only since 2026-02-15, with the user-facing message embedded)
    • D — skip Run/Submit, the rest of the app works

STORY-065 activity log updated with the new findings (public Piston no longer a default fallback option).

Test plan

  • pnpm format:check clean
  • Visual check: user-facing error in the UI now shows the workaround link.

khoks added 2 commits May 18, 2026 00:04
…TORY-065 update

When Piston is unreachable (the Docker Desktop on Windows cgroup v2 case),
the Run/Submit panel previously just showed:

    Run failed
    sandbox_unavailable — Piston execute failed

…with no path forward for a user trying to actually use the app.

Two improvements:

1. RunResultPanel (in both apps/web/src/app/session/SessionClient.tsx and
   apps/web/src/app/playground/PlaygroundClient.tsx) now appends a coach-voice
   explanation + link to docs/operations/SANDBOX.md when
   result.error === 'sandbox_unavailable'. Pure additive: the original error
   + message still render.

2. New docs/operations/SANDBOX.md walks through four fix paths:
   - (A) WSL-native docker engine inside a real Ubuntu distro — recommended;
   - (B) remote Piston on a Linux VM via PISTON_URL;
   - (C) public Piston API — RULED OUT (whitelist-only since 2026-02-15);
   - (D) skip Run/Submit, the rest of the app works.

STORY-065 activity log updated with the new findings (public Piston blocked
as a default fallback).
…l+C and runs --down

Two user-reported bugs from running .\scripts\dev.ps1 in PowerShell:

1. **Ctrl+C didn't tear anything down.** PowerShell's Ctrl+C handling
   killed the bash subprocess before its INT trap could run, leaving
   containers + dev servers orphaned. Fix: register a CancelKeyPress
   handler in dev.ps1 that cancels the default termination and a finally
   block that explicitly runs 'dev.sh --down' to clean up.

2. **Browser didn't open.** dev.sh used a single 'cmd.exe /c start' that
   silently fails when invoked from inside bash-via-PowerShell. Fix: try
   explorer.exe → rundll32 → powershell.exe Start-Process → cmd.exe /c
   start in order, and if all four fail, print the URL with a coach-voice
   note so the user can click/copy it.

These compose with each other — a user running dev.ps1 now gets the
browser opened reliably AND Ctrl+C cleans up everything.
@khoks
khoks merged commit 901cf18 into main May 18, 2026
1 check passed
@khoks
khoks deleted the chore/sandbox-error-message-and-docs branch May 18, 2026 07:12
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