Skip to content

fix(workspace): allow removing missing workspace repos from UI (#2234) - #2253

Open
rishu685 wants to merge 1 commit into
repowise-dev:mainfrom
rishu685:fix/2234-workspace-remove-missing-dir-repo
Open

rishu685 wants to merge 1 commit into
repowise-dev:mainfrom
rishu685:fix/2234-workspace-remove-missing-dir-repo

Conversation

@rishu685

Copy link
Copy Markdown
Contributor

Summary

Closes #2234

When a workspace member directory is removed or renamed on disk:

  1. The server creates a synthetic repo entry with status: "missing_dir" and ID ws:<alias>.
  2. The UI sidebar tells users to open the Workspace page to remove or fix it, but the Workspace page rendered no action buttons for missing_dir rows.
  3. No API endpoint existed to remove workspace configuration entries, and calling DELETE /api/repos/ws:<alias> returned a 404 database error.
  4. Removing via the CLI (repowise workspace remove <alias>) was not reflected in running repowise serve instances because in-memory workspace_config was only loaded at startup.

Changes Made

  • Server Endpoints & Live State Sync:

    • Added DELETE /api/workspace/repos/{alias} in routers/workspace.py to drop the entry from .repowise-workspace.yaml and save the file to disk.
    • Live reload request.app.state.workspace_config and clean up workspace_sessions, workspace_fts, workspace_path_to_repo_id, and workspace_vector_stores caches so the running server immediately reflects the removal without requiring a restart.
    • Added synthetic ws:<alias> ID handling in DELETE /api/repos/{repo_id} (routers/repos.py) to delegate cleanly to workspace configuration removal.
    • Added and re-exported WorkspaceRepoRemovedResponse schema.
  • API Client:

    • Added removeWorkspaceRepo(alias) to packages/api-client/src/workspace.ts and exported WorkspaceRepoRemovedResponse interface.
  • Web UI:

    • Added RemoveWorkspaceRepoButton component in packages/web/src/app/workspace/sync-buttons.tsx.
    • Wired actionsFor in packages/web/src/app/workspace/page.tsx to display the "Remove" button when repo.status === "missing_dir".
  • Unit Tests:

    • Added tests/unit/server/test_workspace_remove_repo.py covering:
      • Successful removal and persistence to .repowise-workspace.yaml
      • Live in-memory state and cache cleanup
      • 404 response for unknown alias
      • 404 response outside workspace mode
      • Synthetic DELETE /api/repos/ws:<alias> deletion

Verification

  • Ran full workspace test suite (74 tests passed):
    pytest tests/unit/server/test_workspace_router.py tests/unit/server/test_workspace_remove_repo.py tests/unit/server/test_workspace_sidebar.py
  • Verified TypeScript builds without errors.

…ise-dev#2234)

- Add DELETE /api/workspace/repos/{alias} endpoint to remove entries from .repowise-workspace.yaml
- Reload workspace_config and clean up live in-memory server state without requiring a restart
- Support synthetic ws: prefixed IDs in DELETE /api/repos/{repo_id}
- Add removeWorkspaceRepo client function in @repowise-dev/api-client
- Render RemoveWorkspaceRepoButton in web UI for missing_dir repos
- Add comprehensive server unit tests in test_workspace_remove_repo.py
@rishu685
rishu685 force-pushed the fix/2234-workspace-remove-missing-dir-repo branch from 7c301dd to 4b3fb25 Compare September 15, 2026 18:22
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.

[Bug] A workspace entry whose directory is gone cannot be removed from the UI — and the sidebar tells you to do exactly that

1 participant