Skip to content

Enable Docker-backed Roomote environment previews - #1317

Draft
daniel-lxs wants to merge 3 commits into
developfrom
agent/roomote-environment-nested-runtime
Draft

Enable Docker-backed Roomote environment previews#1317
daniel-lxs wants to merge 3 commits into
developfrom
agent/roomote-environment-nested-runtime

Conversation

@daniel-lxs

@daniel-lxs daniel-lxs commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

  • add an optional nested_docker environment capability for applications that launch containers dynamically without declaring a placeholder Docker project
  • configure the checked-in Roomote environment to run its controller against Docker and expose authenticated nested task previews through the existing wildcard preview-proxy path
  • repair incomplete demo setup state on rerun so a stale sandbox does not return to the onboarding gate
  • preserve the new field in the YAML editor and document it

Why

The Roomote dogfood environment could create an inner task, but its controller failed before worker startup because the hosting sandbox had no Docker daemon. Its checked-in definition also did not run a nested preview proxy.

The existing runtime selected a Docker-capable Modal VM only when docker_projects was non-empty. Adding a fake Docker project would work around that behavior but would build and run an unrelated container. This change makes the actual requirement explicit instead.

Complexity and security boundary

This PR intentionally does not add parent-runtime delegation, new token types, auth routes, source-control brokers, inference proxies, or credential propagation.

  • nested_docker is optional and defaults off, so ordinary environments retain their current runtime and setup.
  • only the existing authenticated web, docs, and wildcard preview ports are public; the inner API on port 13001 remains local to the sandbox
  • the inner preview proxy uses a distinct cookie name and the existing nested callback/routing behavior
  • inference credentials are not inherited from the hosting task
  • the demo repositories are public, so the initial proof does not require delegated source-control credentials

The production runtime portion is intentionally small: schema support, Modal VM selection, Docker readiness, YAML preservation, and the demo-seed repair.

Test plan when a hosted environment is available

  1. Deploy this branch's matching API, controller, worker, web, and preview-proxy builds.
  2. Reapply .roomote/environments/roomote.yaml and launch a fresh Roomote environment task; do not reuse an older sandbox or snapshot.
  3. Confirm environment setup completes and the Docker readiness check passes.
  4. Open the authenticated Roomote web preview and use development login.
  5. In the inner Roomote, add a dedicated, spend-limited inference credential under Settings → Models. Do not copy the parent run token or production-wide credentials into the environment definition.
  6. Launch a small task against the public Roomote Demo Environment.
  7. Verify the inner controller creates a Docker worker, the task produces assistant output, and the run settles.
  8. Open a child web preview and confirm its nested hostname, authentication callback, WebSocket traffic, and canonical redirects work.
  9. Confirm the outer web/docs/preview surfaces require authentication and that port 13001 has no public preview route.
  10. Remove the temporary inference credential after testing if it is not intended to persist.

If manually configuring an independent inference credential proves too cumbersome, evaluate a separate follow-up for one non-delegatable, run-bound, inference-only capability. Source-control delegation and a general parent-runtime framework remain out of scope.

Validation

  • controller Modal worker tests: 19 passed
  • worker Docker project/runtime tests: 10 passed
  • database seed and declarative environment tests: 17 passed
  • web YAML serialization tests: 8 passed
  • nested preview proxy HTTP, WebSocket, callback, and cookie tests: 45 passed
  • package and repository-wide TypeScript checks
  • full lint and formatting checks
  • Knip
  • shell syntax and local/public preview URL derivation checks
  • git diff --check
  • GitHub CodeQL after the shell-wrapper test rewrite; the prior test-only alert is fixed

@roomote-community

roomote-community Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

No code issues found in updates since 3ed6128; the prior startup finding remains fixed. See task

  • .roomote/scripts/with-nested-preview-env.sh:4 required an environment variable that the runtime did not inject, preventing all wrapped services from starting.

Reviewed e4f760d

Comment thread .roomote/scripts/with-nested-preview-env.sh Outdated
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.

2 participants