microsoft / microsoft/vscode

Agent shell init script is not applied when sandboxing is enabled

Open
#334,582 0 comments 0 reactions 1 assignee Claimed by @anthonykim1 View on GitHub
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

Testing #334389

When shell tool sandboxing is enabled, the configured shell init script is not applied.

### Repro steps

1. Add this to `~/.bashrc`:
```bash
export VSCODE_TPI_PROFILE_MARKER=from-bashrc
```
2. Enable `chat.agentHost.shellTool.initScript.enabled`.
3. Enable shell tool sandboxing.
4. Ask the agent to run:
```bash
printf 'marker=<%s>\n' "${VSCODE_TPI_PROFILE_MARKER-}"
test -e "$HOME/.bashrc" && echo exists || echo missing
```

### Actual result

```text
marker=<>
missing
```

The workspace virtual environment is still injected, but the shell profile is absent inside the sandbox. Disabling sandboxing makes the marker appear.

### Expected result

The configured shell init script should still be applied when sandboxing is enabled, with any required profile files made available read-only.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.