pingdotgg / pingdotgg/t3code

[Bug]: Cannot delete orphaned project after environment is gone

Open
#4,851 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-triage
Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Area

apps/web / project management

Summary

An orphaned T3 Code project cannot be deleted after its original environment/machine is gone.

Affected project
  • Project ID: 59025a7f-1c36-44e0-8960-5f804f645280
  • Display name: dev-network
  • Workspace path: /home/spade/projects/dev-network
  • Environment: devbox

The original machine named/aliased devbox no longer exists. A replacement machine uses the same alias but does not contain this workspace or project record.

Steps to reproduce
  1. In T3 Code, locate the bottom dev-network project.
  2. Choose Remove project.
  3. Confirm removal.
  4. The operation fails because the project still has threads.
  5. Try the CLI force-delete path.
Expected behavior

A project should be force-deletable by project ID even when its environment is offline or permanently gone, its workspace path no longer exists, and it still contains threads.

Actual behavior

The UI confirmation fails with:

Orchestration command invariant failed (project.delete):
Project '59025a7f-1c36-44e0-8960-5f804f645280' is not empty
and cannot be deleted without force=true.

The CLI accepts --force, but the command still cannot remove the orphaned project. Passing the project ID produces:

ProjectNotFoundError: No active project found for '59025a7f-1c36-44e0-8960-5f804f645280'
WorkspaceRootNotExistsError:
Workspace root does not exist:
/home/spade/59025a7f-1c36-44e0-8960-5f804f645280

Passing the displayed workspace path also fails because the original path does not exist on the replacement machine:

ProjectNotFoundError: No active project found for '/home/spade/projects/dev-network'
WorkspaceRootNotExistsError:
Workspace root does not exist: /home/spade/projects/dev-network
Impact

The orphaned project remains permanently visible in the UX and cannot be removed through either the UI or CLI. Recreating the path on the replacement machine does not restore the original project identity/environment and is unsafe because similarly named projects exist.

Suggested fix
  • Allow the project-delete orchestration command to accept force: true from both the UI and CLI.
  • Resolve deletion by project ID without requiring the workspace path to exist.
  • Permit force deletion of the project and all child threads when the environment is permanently unavailable.
  • Ensure the CLI's --force flag is actually forwarded as force: true.
Workaround

None when the original environment/machine no longer exists.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the project-delete orchestration command from the apps/web project-management flow and the CLI force-delete path. Check how the project ID, workspace path, and --force value are handled when the environment is unavailable. Done means force deletion works from both UI and CLI for an orphaned project and its child threads without requiring the workspace to exist.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.