Skip to content

🪲 BUG: Honor the active editor's folder in multi-root workspaces - #25

Closed
FernandoCelmer wants to merge 3 commits into
masterfrom
feature/multiroot-workspace-detection
Closed

🪲 BUG: Honor the active editor's folder in multi-root workspaces#25
FernandoCelmer wants to merge 3 commits into
masterfrom
feature/multiroot-workspace-detection

Conversation

@FernandoCelmer

@FernandoCelmer FernandoCelmer commented Aug 15, 2026

Copy link
Copy Markdown
Member

Closes #26

currentWorkspaceFolder() always returned workspaceFolders[0], so pycodeloop serve spawned with the first root as its cwd regardless of which project the user was actually in. In a multi-root workspace, everything outside that first root tripped the workspace jail and the agent fell back to bash for what should've been a plain file read.

Now resolves the workspace folder containing the active editor's document first, falling back to workspaceFolders[0] when there's no active editor.

Test plan

  • npm test — 50 passed
  • npm run lint clean
  • Not adding a unit test — this file has no existing test coverage since it's tightly coupled to the vscode API (same pattern as chatSidebarProvider.ts)

currentWorkspaceFolder() always returned workspaceFolders[0], so
pycodeloop serve spawned with the first root as its cwd regardless
of which project the user was actually working in. In a multi-root
workspace, every file in a root other than the first tripped the
workspace jail ("outside the workspace") and forced the agent to
fall back to bash for something as simple as reading a file in the
open project. Now resolves the workspace folder that contains the
active editor's document first, falling back to workspaceFolders[0]
only when there's no active editor (e.g. right after the panel
opens).
@FernandoCelmer
FernandoCelmer deleted the feature/multiroot-workspace-detection branch August 15, 2026 21:53
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: Workspace jail ignores active project in multi-root workspaces

1 participant