feat(db): add v2_hosts.allow_cloud_workspaces
Merged
HA
16h ago+17311+17311+01234567890123456789012345678901234567890123456789-0-0-0123456789
Stack: 1 of 3 — this PR → API + relay → desktop + CLI. Merge in order.
Summary
- Adds
v2_hosts.allow_cloud_workspaces boolean NOT NULL DEFAULT false: whether a host's owner lets their cloud workspaces reach it through the relay. - Schema only. Nothing reads or writes it until the next PR in the stack, apart from
host.ensurereturning it as part of the row.
Why / Context
A customer (lucas@traceroot.ai) reported that from a cloud workspace superset hosts list shows their Mac offline and --host calls fail with "Session expired". Making that work needs a per-host opt-in, and this column is where it lives. Related: SUPER-2661, SUPER-2852.
Migration safety
- One statement:
ALTER TABLE "v2_hosts" ADD COLUMN "allow_cloud_workspaces" boolean DEFAULT false NOT NULL; - A constant default on Postgres 11+ is metadata-only: no table rewrite, only a brief lock on
v2_hosts. That table is not in the hot-table list in.agents/skills/db-migrations/SKILL.md, and no job holds it open. - No tRPC input or procedure change in this PR, per rule 10 / the checklist. One side effect:
host.ensurereturns the whole row, so its output gainsallowCloudWorkspaces. That's additive and safe for released clients. - Not rehearsed under load, because it locks only
v2_hostsbriefly and scans nothing. I did not check production table sizes (no production access from here). - Applied to this workspace's Neon dev branch with the neon-serverless migrator; the column read back as
boolean, defaultfalse. Note: it was applied there as0189beforemaingained its own0189, so that dev branch needs a reset before applying this one cleanly.
Testing
bun run typecheckinpackages/dbdrizzle-kit generateon top ofmainproduced only the one statement above.
Rollback
Forward-only and inert on its own. Reverting the PR before the next one merges leaves no reader. After that, roll back the API PR first.
Summary by cubic
Adds v2_hosts.allow_cloud_workspaces, a boolean column defaulting to false, so a host's owner can opt in to letting their cloud workspaces reach it through the relay. Schema only — nothing reads or writes it until the next PR in the stack.
- A customer (lucas@traceroot.ai) reported
superset hosts listshowing their Mac offline and--hostcalls failing with "Session expired" from a cloud workspace; related to SUPER-2661 and SUPER-2852. - The migration is one
ALTER TABLEwith a constant default, which is metadata-only on Postgres 11+: no table rewrite, only a brief lock onv2_hosts. - Rollback is a revert before the next PR merges; after that, roll back the API PR first.
Summary by CodeRabbit
- Updates
- Host configuration now includes a setting that determines whether cloud workspaces can reach the host through the relay. The setting defaults to off, so cloud workspace access remains unavailable unless it is enabled. This provides a clear default for host access while allowing configurations to specify whether cloud workspace connections are permitted.