Refs: #313679, #313160
Complexity: 3
Create Issue
This test verifies that Agent host (local) terminals and shell tools from Agent Host Copilot CLI use the shell path from the user's terminal profile preferences, instead of always defaulting to the system shell.
This PR adds three new settings:
terminal.integrated.agentHostProfile.linux
terminal.integrated.agentHostProfile.osx
terminal.integrated.agentHostProfile.windows
Resolution order for the shell used by agent host (local) terminals:
terminal.integrated.agentHostProfile.<os> — if set, takes priority.
terminal.integrated.defaultProfile.<os> — used when the agent host profile is unset.
- System default shell — fallback when neither is set.
Caveats:
- Only the profile's executable path is honored.
args and env from the profile are ignored.
- Applies to the local agent host only.
- The shell tool the model gets routed to (
bash vs. powershell) is derived from the resolved executable basename. Examples: pwsh / powershell → powershell; bash / zsh / fish / sh → bash. The "wrong" tool is stubbed so the model can't bypass the override.
Requirements
- Latest VS Code Insiders
chat.agentHost.enabled set to true
- Copilot CLI installed and authenticated
- At least two distinct shells available on the test machine
Steps
Part 1: agentHostProfile.<os> takes priority
- Open VS Code Insiders.
- Set
terminal.integrated.agentHostProfile.<your-os> to a non-default shell (e.g., on macOS set it to a profile pointing at /bin/bash even though zsh is your default).
- Open a Copilot CLI agent host session in the chat panel.
- Ask the agent to run a shell command that reveals the shell, or print something and ask which shell agent used to run something in the terminal.
- Verify the agent's tool execution used the configured
agentHostProfile.<os> shell — not the OS default.
Part 2: Fallback to defaultProfile.<os>
- Unset (or remove)
terminal.integrated.agentHostProfile.<os>.
- Set
terminal.integrated.defaultProfile.<os> to a non-system-default shell.
- In a fresh Copilot CLI agent host session, ask the agent to run a shell command that reveals the shell.
- Verify the agent uses the
defaultProfile.<os> shell.
- Unset
defaultProfile.<os> as well and verify the agent falls back to the system default shell.
Part 3: Shell-tool routing (bash vs. powershell)
- Configure
agentHostProfile.<os> so the resolved executable is a POSIX shell (e.g., bash, zsh, fish, sh, or on Windows: Git Bash / WSL).
- In a Copilot CLI agent host session, ask the agent to run a basic command. Verify it succeeds (the agent should be using the bash tool).
- Switch
agentHostProfile.<os> to a PowerShell executable (e.g., pwsh or powershell.exe).
- Reload / start a fresh session and ask the agent to run a basic command. Verify it succeeds and uses PowerShell semantics.
Part 4: Invalid / inaccessible path
- Set
terminal.integrated.agentHostProfile.<os> to an executable path that does not exist (e.g., /does/not/exist/sh).
- Start a Copilot CLI agent host session and ask the agent to run a command.
- Verify the agent host falls back to the system shell rather than failing the session (a warning should be logged in the Output panel for the agent host).
Notes for filing issues
If the agent host doesn't pick the expected shell, please include:
- Values of
terminal.integrated.agentHostProfile.<os> and terminal.integrated.defaultProfile.<os>
- The shell the agent actually used (output of the reveal command)
- Whether the wrong-shell tool stub message appeared in the response
- Value of
chat.agentHost.enabled
- OS, OS version, and VS Code Insiders commit
Refs: #313679, #313160
Complexity: 3
Create Issue
This test verifies that Agent host (local) terminals and shell tools from Agent Host Copilot CLI use the shell path from the user's terminal profile preferences, instead of always defaulting to the system shell.
This PR adds three new settings:
terminal.integrated.agentHostProfile.linuxterminal.integrated.agentHostProfile.osxterminal.integrated.agentHostProfile.windowsResolution order for the shell used by agent host (local) terminals:
terminal.integrated.agentHostProfile.<os>— if set, takes priority.terminal.integrated.defaultProfile.<os>— used when the agent host profile is unset.Caveats:
argsandenvfrom the profile are ignored.bashvs.powershell) is derived from the resolved executable basename. Examples:pwsh/powershell→powershell;bash/zsh/fish/sh→bash. The "wrong" tool is stubbed so the model can't bypass the override.Requirements
chat.agentHost.enabledset totrueSteps
Part 1:
agentHostProfile.<os>takes priorityterminal.integrated.agentHostProfile.<your-os>to a non-default shell (e.g., on macOS set it to a profile pointing at/bin/basheven thoughzshis your default).agentHostProfile.<os>shell — not the OS default.Part 2: Fallback to
defaultProfile.<os>terminal.integrated.agentHostProfile.<os>.terminal.integrated.defaultProfile.<os>to a non-system-default shell.defaultProfile.<os>shell.defaultProfile.<os>as well and verify the agent falls back to the system default shell.Part 3: Shell-tool routing (bash vs. powershell)
agentHostProfile.<os>so the resolved executable is a POSIX shell (e.g.,bash,zsh,fish,sh, or on Windows: Git Bash / WSL).agentHostProfile.<os>to a PowerShell executable (e.g.,pwshorpowershell.exe).Part 4: Invalid / inaccessible path
terminal.integrated.agentHostProfile.<os>to an executable path that does not exist (e.g.,/does/not/exist/sh).Notes for filing issues
If the agent host doesn't pick the expected shell, please include:
terminal.integrated.agentHostProfile.<os>andterminal.integrated.defaultProfile.<os>chat.agentHost.enabled