Skip to content

[Improve] Prefer configured cloud sandbox provider over Local Docker#498

Merged
brunobergher merged 2 commits into
developfrom
improve/prefer-cloud-compute-default-1ryfuh61bs354
Jul 17, 2026
Merged

[Improve] Prefer configured cloud sandbox provider over Local Docker#498
brunobergher merged 2 commits into
developfrom
improve/prefer-cloud-compute-default-1ryfuh61bs354

Conversation

@roomote-roomote

@roomote-roomote roomote-roomote Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Opened on behalf of Bruno Bergher. Follow up by mentioning @roomote-roomote, in the web UI, or in Slack.

Related issue

N/A — internal request to fix the homepage/default sandbox provider when both Local Docker and a cloud provider are configured.

Why this PR exists

  • A maintainer explicitly invited this PR in the linked issue or discussion
  • I am a maintainer / this is internal Roomote work

What changed

When Local Docker and at least one cloud sandbox provider are both configured, the default sandbox provider preference is now a configured cloud provider instead of Local Docker.

  • DEFAULT_COMPUTE_PROVIDER=docker (common in compose/local stacks) no longer outranks a ready cloud provider for the resolved deployment default
  • When multiple cloud providers are ready, prefer the last one in setup-catalog order (stable, deterministic tiebreak)
  • Explicit persisted admin default still wins
  • Homepage initial selection follows the same preference when the provided server default is not among available providers
  • Hot-path non-Docker env defaults return immediately without a catalog-wide readiness scan (enqueue/retry/dequeue paths)

How it was tested

  • @roomote/types setup-compute-config unit tests
  • @roomote/db compute-runtime-config unit tests (including resolveDefaultComputeProvider and a regression that non-Docker env defaults skip catalog env-var selects)
  • @roomote/web Home client tests for fallback selection among available providers
  • Pre-push checks (oxlint, residual lint, check-types:fast, knip) passed on push

Checklist

  • The PR title follows the repo convention: [Fix], [Feat], [Improve], [Refactor], [Docs], or [Chore] followed by a user-facing description
  • This PR is small and scoped to one change
  • pnpm lint and pnpm check-types pass locally
  • I added tests or included a clear manual validation note above
  • I removed secrets, tokens, private keys, and customer data from code, logs, and screenshots
  • If this change should appear in the changelog, I ran pnpm changeset

When Local Docker and a cloud provider are both available, default to the
last catalog-ordered configured cloud instead of DEFAULT_COMPUTE_PROVIDER=docker.
@roomote-roomote

roomote-roomote Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

No new code issues found. See task

  • packages/db/src/lib/compute-runtime-config.ts:153 Avoid unconditional catalog-wide provider configuration queries in resolveDefaultComputeProvider. The function is used on task enqueue, retry, and controller dequeue paths, but now calls listConfiguredComputeProviders before checking an explicit non-Docker DEFAULT_COMPUTE_PROVIDER; that helper performs one deployment-settings read plus sequential environment-variable reads for every catalog provider. Preserve the direct return for authoritative non-Docker env defaults and limit the full readiness scan to cases that need cloud-vs-Docker fallback resolution.

Reviewed 6bbb1e8

@roomote-roomote

roomote-roomote Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the open review item.

resolveDefaultComputeProvider now returns immediately for idle non-Docker DEFAULT_COMPUTE_PROVIDER values and only runs the catalog readiness scan when resolving docker-vs-cloud fallback (or when the env default is unset).

Shipped in 6bbb1e8.

Preserve immediate return for authoritative non-Docker DEFAULT_COMPUTE_PROVIDER
and only scan configured cloud providers when resolving docker-vs-cloud fallback.
@brunobergher
brunobergher marked this pull request as ready for review July 17, 2026 17:04
@brunobergher
brunobergher merged commit 15a6da8 into develop Jul 17, 2026
16 checks passed
@brunobergher
brunobergher deleted the improve/prefer-cloud-compute-default-1ryfuh61bs354 branch July 17, 2026 17:06
@roomote-roomote roomote-roomote Bot mentioned this pull request Jul 17, 2026
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