Commit Graph
3 Commits
Author SHA1 Message Date
Rohit C Prasad 56a7fe37b6 Sandbox starts at the first turn; Mac gateway restart; plain preparing line
A session's sandbox is made when its first turn runs, not at connect or folder pick.
The folder step restarts the Homebrew gateway on a Mac and checks the config in use.
The preparing line names the real sandbox.
2026-09-28 18:01:42 -07:00
Devika Verma ab4d6dda77 Sandbox refusal: no reconnect loop; image check follows the driver (docker or podman) and stays out of remote gateways
Review of OPE-205/OPE-206 found three gaps:

- The client reconnects with backoff on ANY socket close, so a session refused for a
  missing image would be retried every few seconds, adding an error notice each time
  and showing the "reconnecting" strip forever. The server now closes a refused session
  with code 4403; the client treats that as final (no reconnect, no strip) and the
  error notice in the transcript says why.
- The image check only knew Docker, while docs promise Docker or Podman. It now maps the
  gateway's driver to its own tool (`docker`/`podman image inspect`, `... pull`), and
  the refusal and the setup hint name that tool.
- A local image store says nothing about a remote gateway's images: when the active
  gateway is remote, the check answers "cannot tell" and never refuses.
2026-09-26 21:54:54 +05:30
Devika Verma 5e16e26b1d Session socket: build the engine (and its sandbox) off the event loop, and say so (OPE-206)
Connecting a session's socket built its engine on the event loop. With OpenShell that
build creates a container, starts the runner and verifies the mounts: seconds normally,
minutes on first use. While it ran the server answered nothing, the GUI's health checks
failed, and the app fell back to its startup screen ("Starting OpenWorker...") instead of
showing the session. A build that raised (a refused sandbox, a timeout) died in the ASGI
stack and the socket just dropped.

Now the socket handler asks `pending_sandbox_build()` (config only, no preflight) whether
this connect will build a sandbox, sends `sandbox_preparing` if so, runs `get_engine` on
a worker thread, then sends `sandbox_ready` with the workspace's description, or an
`error` event with the reason and a clean close. Engine builds are serialized per session
with a lock, since two connects could now build concurrently and with OpenShell each
build is a container.

The GUI renders the two events: a waiting row "Preparing the openshell sandbox for this
session..." until `ready`, and one quiet transcript line naming the wall once it is up.
A refusal lands in the session view as the usual error notice.
2026-09-26 17:17:12 +05:30