Conversation
There was a problem hiding this comment.
Pull request overview
Adds end-to-end “delete realm/workspace” support, spanning host UI (workspace chooser action + destructive confirmation), realm-server endpoint implementation, and test coverage to validate both server-side deletion behavior and the host flow.
Changes:
- Added
DELETE /_delete-realmrealm-server endpoint and wired it into routing. - Introduced shared realm destruction utilities and refactored unpublish to use them.
- Added realm-server endpoint tests, host acceptance tests, and CI inclusion for the new test module.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/realm-server/tests/server-endpoints/delete-realm-test.ts | New endpoint coverage for deleting source realms, published copies, permissions, and domain-claim soft deletion. |
| packages/realm-server/tests/index.ts | Registers the new delete-realm endpoint test. |
| packages/realm-server/routes.ts | Adds DELETE /_delete-realm route with JWT middleware. |
| packages/realm-server/handlers/realm-destruction-utils.ts | New shared helper for deleting realm contents + unmounting. |
| packages/realm-server/handlers/handle-unpublish-realm.ts | Refactors published realm removal to use the new shared helper. |
| packages/realm-server/handlers/handle-delete-realm.ts | New handler implementing the server-side realm deletion flow. |
| packages/host/tests/helpers/realm-server-mock/routes.ts | Adds mock realm-server route for /_delete-realm used by host acceptance tests. |
| packages/host/tests/acceptance/workspace-chooser-delete-test.gts | Adds acceptance coverage for enabling/disabling delete and for the delete confirmation UI content. |
| packages/host/app/services/realm.ts | Adds removeRealm() to evict a realm resource locally after deletion. |
| packages/host/app/services/realm-server.ts | Adds deleteRealm() client method calling the new realm-server endpoint. |
| packages/host/app/services/matrix-service.ts | Adds helper to remove a realm URL from Matrix account data. |
| packages/host/app/components/operator-mode/workspace-chooser/workspace.gts | Adds workspace context menu + delete confirmation modal and deletion workflow. |
| packages/host/app/components/operator-mode/workspace-chooser/index.gts | Enables the workspace menu in the chooser list. |
| packages/host/app/components/operator-mode/delete-modal.gts | Makes delete modal content more flexible and adds size override support. |
| .github/workflows/ci.yaml | Ensures the new realm-server endpoint test is included in CI’s test-module list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/host/app/components/operator-mode/workspace-chooser/index.gts
Outdated
Show resolved
Hide resolved
Preview deployments |
|
I had no design for this so I vibed it. I'll show it to the design people and get feedback. In the meanwhile this is ready for review. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec5b945584
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
packages/host/app/components/operator-mode/workspace-chooser/workspace.gts
Show resolved
Hide resolved
packages/host/app/components/operator-mode/workspace-chooser/workspace.gts
Show resolved
Hide resolved
|
are there any odd behaviors if you have an existing chat with AI that has artifacts from a deleted realm? |
|
@IanCal this is the PR that we can use for removing a realm for teh software factory so that realms become more disposable. probably a good next step is to make a command and skill for this (and prob refactor the menu logic here to call the command) |
| return response.body.data.id as string; | ||
| } | ||
|
|
||
| test('DELETE /_delete-realm removes a created realm, its published copies, and related domain claims', async function (assert) { |
There was a problem hiding this comment.
i think there is more cleanup. we should delete all items for the deleted realm in the realm_versions, boxel_index, boxel_working_index, and modules tables and add assertions our tests for that. Also probably we should delete any pending jobs in the jobs table that are tied to the deleted realm's concurrency group (indexing:<realm_url>)
There was a problem hiding this comment.
maybe also ask AI to think of any other tables that might need cleanup
There was a problem hiding this comment.
maybe a way to detect this is to dump the database and look for any mentions of the should-have-been-deleted realm name
ed5185d to
fba75a9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/host/app/components/ai-assistant/message/attachments.gts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
15462bc to
666e0a0
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
666e0a0 to
87e52d7
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e26502b230
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| private get canDeleteWorkspace() { | ||
| return this.realm.isRealmOwner(this.args.realmURL); |
There was a problem hiding this comment.
Disable delete action for non-creator realm owners
The chooser enables deletion based only on this.realm.isRealmOwner(this.args.realmURL), but the server endpoint also requires the realm namespace to match the current Matrix username (packages/realm-server/handlers/handle-delete-realm.ts, ownerNamespace !== getMatrixUsername(ownerUserId)). In delegated-owner scenarios this exposes a destructive action that is guaranteed to fail with 403 after confirmation, so users can repeatedly enter a broken flow instead of seeing the action disabled up front.
Useful? React with 👍 / 👎.


Screen.Recording.2026-03-12.at.13.19.09.mov
Summary