Skip to content

feat(computers): shared cloud computers that admins grant to members and agents - #7902

Open
benjaminshafii wants to merge 1 commit into
feat/computer-sizesfrom
feat/named-computer-grants
Open

benjaminshafii wants to merge 1 commit into
feat/computer-sizesfrom
feat/named-computer-grants

Conversation

@benjaminshafii

Copy link
Copy Markdown
Member

What is this about?

An admin can record a named cloud computer that belongs to the organization and grant it to members and agents one by one. Off by default behind computerGrants.

Nobody can open a shared computer yet. This PR ships the record, the grants, the access check and the listings only.

What problem does it solve?

Every cloud computer belonged to exactly one member. There was no way to say "this build machine is the organization's, and Priya and the Build helper agent may use it".

What was the situation before?

A cloud computer always had one owner, and only that owner could use it. Nothing in the data could express a computer without an owner, or a second person allowed on one.

How is this implemented?

  • Migration 0232_cloud_computer_grant: a cloud_computer_grant table and a nullable worker.shared_name, unique per organization.
  • Six routes under /v1/org/computers/shared in ee/apps/den-api/src/routes/org/computers.ts, logic in organization-shared-computers.ts. Create, grant and revoke need computers.create and a recent sign-in.
  • workers/worker-access.ts gains "this computer, for this member": yes only for a computer with a shared name and no owner, in the caller's organization, with a live grant. A member's own computer can never be granted, even with a grant row written straight into the database.
  • Removing a member, archiving an agent or deleting the organization deletes the grants.
  • openwork computers create --name, grant, revoke, grants.
  • Flag and doc: packages/features/src/flags/computer-grants.ts, docs/features/computer-grants/README.md.

What else changed?

Release note

none

Evidence

  • No E2E spec: API and CLI only. computer-grants.api.test.ts (16 tests against MySQL, including other organizations' ids and the personal-computer refusal) and the CLI tests.
  • Not built, on purpose: starting or connecting to a shared computer, and keeping several members' credentials and files apart on one machine. That needs a design first.
  • Not run live: no shared computer has been started anywhere.

…hem to members and agents

An admin can record a named cloud computer that belongs to the organization
instead of to a member, and grant it to one member or one agent at a time.
The access check gains a form that lets in a granted current member, with
exactly an owner's rights, and nobody else. A revoke takes effect on the next
check, and removing a member, archiving an agent or deleting the organization
deletes the grants involved. A member's own computer can never be granted.

Members and agents cannot open a shared computer yet. No machine is started
and no token is made; this ships the record, the grants, the access check and
the listings. The feature document lists what reaching one still needs.

Everything is behind the computerGrants flag, which is off by default and
cloud only. With it off the six new routes answer 404 and nothing else
changes. The routes live under /v1/org/computers/shared; creating, granting
and revoking need computers.create with a recent sign-in, and the lists need
computers.view. The CLI gains computers create --name, grant, revoke and
grants.

Adds migration 0232_cloud_computer_grant: a nullable worker.shared_name with a
unique index per organization, and the cloud_computer_grant table with a
unique index on worker and member.

Tested with ee/apps/den-api/test/api/computer-grants.api.test.ts (16 tests:
flag off, wrong role, another organization's ids, personal computers never
grantable, the access check, revoke, member removal, organization deletion)
and the CLI tests in packages/cli/test/agents.test.ts. The access check ran
only in tests with the cloud runtime replaced by stand-ins.
@vercel

vercel Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openwork-app Ready Ready Preview Dec 1, 2026 3:19am UTC
openwork-den Ready Ready Preview Dec 1, 2026 3:19am UTC
openwork-landing Ready Ready Preview, v0 Dec 1, 2026 3:19am UTC

Request Review

This branch was successfully deployed

3 active deployments
Preview – openwork-app — eefd34cd Deployed Dec 1, 2026 by vercel[bot]
Preview – openwork-den — eefd34cd Deployed Dec 1, 2026 by vercel[bot]
Preview – openwork-landing — eefd34cd Deployed Dec 1, 2026 by vercel[bot]
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