fix(#2329): apply namespace scope to shellCwd in resolveExecuteCwd [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #2434
Open
waterWang wants to merge 1 commit into
Conversation
…ExecuteCwd [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
approved these changes
Jul 28, 2026
oss-maintainer
left a comment
Collaborator
There was a problem hiding this comment.
Summary
Same fix as #2435 — correctly applies namespace isolation on top of shellCwd in resolveExecuteCwd().
Analysis
The logic is identical to #2435: extract a base path, then resolve namespace segments on top. Build passes.
Note: This is a duplicate of #2435 for the same issue (#2329). The author should close one of the two PRs to avoid confusion during merge.
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
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.
Description
Fixes #2329
When
IsolationScope.SESSIONorIsolationScope.USERis configured, theexecute_shell_commandtool should automatically resolve the working directory to the isolated path (e.g.,workspace/<session_id>/). However, whenshellCwdis explicitly set (to the project root) inLocalFilesystemWithShell, theresolveExecuteCwdmethod returns it directly without applying the namespace scope.Root Cause
In
LocalFilesystemWithShell.resolveExecuteCwd(), the early return for non-nullshellCwdbypasses the namespace factory entirely:Fix
The namespace prefix is now applied to
shellCwdwhen it is set, just as it is applied togetCwd()whenshellCwdis null. This ensures that shell commands run in the isolated directory matching the session/user scope.Testing
IsolationScope.SESSIONis configured,execute_shell_commandnow resolves to<shellCwd>/<sessionId>/instead of just<shellCwd>shellCwdis null, behavior is unchanged (namespace still applied togetCwd())Wallet: FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH