Skip to content

fix(web): a room can never be the selected bench (CL-8551) - #920

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-8551-bench-not-room
Sep 18, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-8551-bench-not-room

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Contributor

Summary

  • resolveSelection/isBenchMembership treated any tenant with a non-raw-id name as a bench. Rooms are named child tenants, so once selectTenant ran with a room's id (command palette's action:switch-workbenchnextWorkbench), the room satisfied the same check and became the selected bench — /new, "+ Create agent", and the Agents page then all operated inside the room.
  • A bench is now a top-level tenant: GET /api/tenants/:tenantId's parentId (already returned by the vendored route, TenantResponse in @intx/types), fetched once per membership via useQueries in BenchProvider. isBenchMembership/resolveSelection now take a parentByTenantId map and never guess from the tenant name.
  • BenchProvider exposes the resolved set as benchMemberships on BenchState. The command palette's switch-workbench and the global Routines aggregation (global-routines.ts) now read benchMemberships instead of re-deriving their own name-based filter — both used to import isBenchMembership directly.
  • Deleted the old name-based resolveSelection unit tests and replaced them with parent-based ones, including one asserting a room can never resolve as the bench even when it is the stored id, and one for an unresolved parent (never guessed as a bench).

Test plan

  • bun run check (typecheck, lint, fmt, test) passes
  • bun test apps/web/src/bench-context.test.ts (7 pass)

resolveSelection/isBenchMembership used to treat any non-raw-id tenant
name as a bench, but rooms are named child tenants too — once
selectTenant ran with a room id, the room satisfied the same check and
became the selected bench, so /new, "+ Create agent", and the Agents
page all operated inside the room.

A bench is now defined as a top-level tenant: GET /api/tenants/:id's
parentId, fetched once per membership and never guessed from the
tenant's name. BenchProvider exposes the resolved set as
benchMemberships, which the command palette's switch-workbench and the
global Routines aggregation now read instead of re-deriving their own
name-based filter.
@linear-code

linear-code Bot commented Sep 18, 2026

Copy link
Copy Markdown

CL-8551

@TheGreatAxios
TheGreatAxios merged commit b878174 into main Sep 18, 2026
4 checks passed
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.

1 participant