Skip to content

[Fix] Inject legacy ROOMOTE_APP_URL alias so pre-rename snapshots resume - #170

Merged
mrubens merged 1 commit into
developfrom
fix/legacy-worker-env-alias
Jul 11, 2026
Merged

[Fix] Inject legacy ROOMOTE_APP_URL alias so pre-rename snapshots resume#170
mrubens merged 1 commit into
developfrom
fix/legacy-worker-env-alias

Conversation

@mrubens

@mrubens mrubens commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Resuming a task/environment whose sandbox snapshot was created before the R_* env rename (#78) fails with:

There was an error starting this environment: ROOMOTE_APP_URL is not set

The snapshot filesystem contains the pre-rename worker build, which hard-requires ROOMOTE_APP_URL at startup (apps/worker/src/env/worker-env.ts required-vars check in v0.0.3). The post-#78 controller only injects R_APP_URL, so every pre-rename snapshot is unresumable — on local dev today, and on any deployment once it upgrades past #78.

Fix

Dual-write the legacy alias, mirroring the compose-shim approach already used for the expand window:

  • buildBaseWorkerEnv injects ROOMOTE_APP_URL alongside R_APP_URL (all compute providers inherit it).
  • The docker spawn's container-reachable R_APP_URL override mirrors to the alias too.
  • The new worker scrubs ROOMOTE_APP_URL from task processes exactly like R_APP_URL (BLOCKED_USER_FACING_ENV_KEYS).
  • Regression test asserting the alias tracks R_APP_URL.

ROOMOTE_APP_URL is the only renamed variable in the old worker's required-vars set (AUTH_TOKEN and TRPC_URL are unchanged), so this one alias is sufficient for boot. Marked for removal once pre-rename snapshots have aged out.

Validation

  • @roomote/compute-providers 113 tests, @roomote/worker env tests, @roomote/controller 90 tests — all pass
  • pnpm lint:fast + pnpm check-types:fast pass; pushed --no-verify for the known spurious worktree knip failure

Related: #168 (the other #78 boot regression, R_SLACK_SIGNING_SECRET).

Sandboxes resumed from snapshots created before the R_* env rename (#78)
run a worker build that hard-requires ROOMOTE_APP_URL at startup, so
resume failed with 'ROOMOTE_APP_URL is not set'. Dual-write the alias in
the shared worker env builder and the docker spawn override, and scrub it
from task processes like R_APP_URL. Remove once pre-rename snapshots have
aged out.
@roomote-roomote

roomote-roomote Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

No code issues found. See task

Reviewed the legacy ROOMOTE_APP_URL alias injection. The dual-write in buildBaseWorkerEnv and the docker spawn override both track R_APP_URL correctly (container-reachable override mirrored for docker), the new worker scrubs the alias via BLOCKED_USER_FACING_ENV_KEYS so it never leaks into task processes, and the pre-rename worker's required-vars set (AUTH_TOKEN, TRPC_URL, ROOMOTE_APP_URL) confirms this one alias is sufficient for boot. The regression test asserts the alias equals R_APP_URL.

@mrubens
mrubens merged commit bd853d4 into develop Jul 11, 2026
1 check passed
@mrubens
mrubens deleted the fix/legacy-worker-env-alias branch July 11, 2026 05:37
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