fix(shell): default no-cwd shell commands to context.workspace#4673
Conversation
When the BashTool receives no explicit `cwd`, the working directory now defaults to `context.workspace` (the sub-agent's worktree when `worktree: true` was used) instead of `None`, which fell through to the shared ShellManager's parent-workspace default. This ensures sub-agents in isolated worktrees run shell commands in their worktree directory rather than the parent checkout. Previously, the foreground execution path (`execute_foreground_via_background`) always passed `None` as the working directory, so it always used the ShellManager's `default_workspace` regardless of the input `cwd`. Now the resolved `working_dir` from the BashTool's cwd handling is threaded through to the execution path. Co-authored-by: fleitz <fleitzo@gmail.com>
|
Thanks @fleitz for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Detect the selected workspace through marker files instead of comparing path spellings. This keeps Fred Leitz’s regression meaningful on PowerShell, where canonical and printed Windows paths can differ. Signed-off-by: Hunter B <hmbown@gmail.com>
|
Maintainer follow-up added without rewriting Fred’s commit: The newly authorized Windows matrix run confirmed the implementation itself and 7,694 other TUI tests, but its new regression compared PowerShell |
Hmbown
left a comment
There was a problem hiding this comment.
Reviewed the exact contributor commit and the additive portability follow-up. The original Fred Leitz commit 6d0ebc8 remains unchanged; 64ddbdf makes only the regression test path-independent. Focused local shell tests passed, and hosted lint, DCO, macOS, Windows, web, and offline eval checks are green.
Map Fred Leitz to his canonical GitHub noreply identity and allow only PR Hmbown#4673 exact commit trailer to resolve through it, preserving the reviewed contributor commit without weakening the gate for altered identities. Co-authored-by: Fred Leitz <345780+fleitz@users.noreply.github.com> Signed-off-by: Hunter B <hmbown@gmail.com>
Label v0.9.1 as an unpublished source candidate while keeping v0.9.0 as the verified latest release. Correct channel and Android/Termux preview guidance, narrow model claims, synchronize localized README controls, and credit @fleitz for PR #4673/#4674 without rewriting contributor history. Signed-off-by: Hunter B <hmbown@gmail.com>
When the BashTool receives no explicit
cwd, the working directory now defaults tocontext.workspace(the sub-agent's worktree whenworktree: truewas used) instead ofNone, which fell through to the shared ShellManager's parent-workspace default.This ensures sub-agents in isolated worktrees run shell commands in their worktree directory rather than the parent checkout.
The fix threads the resolved
working_dirthroughexecute_foreground_via_background(which previously always passedNone) and adds a test that verifies the context.workspace priority over the ShellManager's default_workspace.Closes #4674