-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix VSCode extension by restoring /containers/info endpoint (Vibe Kanban) #1884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…changed:
**File: `crates/server/src/routes/containers.rs`**
1. Added `use uuid::Uuid;` import
2. Added `ContainerInfo` struct with `project_id`, `task_id`, and `attempt_id` fields
3. Added `get_container_info` handler that resolves the container reference and maps `workspace_id` → `attempt_id` for VSCode extension compatibility
4. Registered the `/containers/info` route
The VSCode extension can now call `GET /api/containers/info?ref={folder_path}` to auto-detect workspaces when opening a folder.
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
**How the fix works:** | Scenario | `container_ref` in DB | Path VSCode opens | Lookup method | |----------|----------------------|-------------------|---------------| | Multi-repo | `/workspaces/abc123` | `/workspaces/abc123` | Exact match ✓ | | Single-repo | `/workspaces/abc123` | `/workspaces/abc123/my-repo` | Prefix match ✓ | The `resolve_container_ref_by_prefix` method: 1. First tries exact match (handles multi-repo case) 2. Falls back to prefix match using SQLite GLOB: `path GLOB container_ref || '/*'` (handles single-repo case where path is a subfolder) This should handle both cases correctly. The confidence is higher now because we've accounted for how "Open in IDE" behaves differently based on repo count.
- Unix paths: `/workspaces/abc123/repo-name` matches `/workspaces/abc123` via `/*` - Windows paths: `C:\workspaces\abc123\repo-name` matches `C:\workspaces\abc123` via `\*`
Instead of doing path prefix matching in SQL (which doesn't handle Windows backslashes), we now: 1. Try exact match on the path 2. If not found, try the parent directory (handles single-repo case) This uses std::path::Path::parent() which handles path separators correctly on all platforms. Co-Authored-By: Claude Opus 4.5 <[email protected]>
7f7c559 to
1f9411d
Compare
abcpro1
approved these changes
Jan 13, 2026
stevepisani
pushed a commit
to TabbyStack/vibe-kanban
that referenced
this pull request
Jan 15, 2026
…ban) (BloopAI#1884) * The code compiles. The fix is complete. Here's a summary of what was changed: **File: `crates/server/src/routes/containers.rs`** 1. Added `use uuid::Uuid;` import 2. Added `ContainerInfo` struct with `project_id`, `task_id`, and `attempt_id` fields 3. Added `get_container_info` handler that resolves the container reference and maps `workspace_id` → `attempt_id` for VSCode extension compatibility 4. Registered the `/containers/info` route The VSCode extension can now call `GET /api/containers/info?ref={folder_path}` to auto-detect workspaces when opening a folder. * Moved the doc comment to the route registration where it's more visible. * Everything compiles. Let me summarize the logic: **How the fix works:** | Scenario | `container_ref` in DB | Path VSCode opens | Lookup method | |----------|----------------------|-------------------|---------------| | Multi-repo | `/workspaces/abc123` | `/workspaces/abc123` | Exact match ✓ | | Single-repo | `/workspaces/abc123` | `/workspaces/abc123/my-repo` | Prefix match ✓ | The `resolve_container_ref_by_prefix` method: 1. First tries exact match (handles multi-repo case) 2. Falls back to prefix match using SQLite GLOB: `path GLOB container_ref || '/*'` (handles single-repo case where path is a subfolder) This should handle both cases correctly. The confidence is higher now because we've accounted for how "Open in IDE" behaves differently based on repo count. * Everything compiles. Now the query handles both: - Unix paths: `/workspaces/abc123/repo-name` matches `/workspaces/abc123` via `/*` - Windows paths: `C:\workspaces\abc123\repo-name` matches `C:\workspaces\abc123` via `\*` * Use std::path for cross-platform parent directory lookup Instead of doing path prefix matching in SQL (which doesn't handle Windows backslashes), we now: 1. Try exact match on the path 2. If not found, try the parent directory (handles single-repo case) This uses std::path::Path::parent() which handles path separators correctly on all platforms. Co-Authored-By: Claude Opus 4.5 <[email protected]> --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the VSCode extension which stopped working after commit
22ff27d8f("feat: multi repo projects") removed the/containers/infoendpoint.Changes
GET /containers/info?ref={path}endpoint incontainers.rsContainerInfostruct that returnsproject_id,task_id, andattempt_idworkspace_idtoattempt_idfor backward compatibility with the extensionWhy
The VSCode extension (
vibe-kanban-vscode) calls/api/containers/info?ref={folder_path}to auto-detect workspaces when a folder is opened. This endpoint was accidentally removed during the multi-repo projects refactor. The extension expects a response with{ data: { project_id, task_id, attempt_id } }to construct the URL for loading the sidebar.Implementation Details
Workspace::resolve_container_ref()methodworkspace_idasattempt_idsince the frontend routes still use the "attempt" naming convention but now work with workspace IDsFixes #1793
This PR was written using Vibe Kanban