Skip to content

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

Merged
FernandoCelmer merged 3 commits into
masterfrom
feature/26
Aug 15, 2026
Merged

🪲 BUG-#26: Honor the active editor's folder in multi-root workspaces#27
FernandoCelmer merged 3 commits into
masterfrom
feature/26

Conversation

@FernandoCelmer

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.

(Supersedes #25, closed when its branch got renamed to match the git-flow feature/N convention.)

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 merged commit abe0dd3 into master Aug 15, 2026
4 checks passed
@FernandoCelmer
FernandoCelmer deleted the feature/26 branch August 15, 2026 21:54
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