microsoft / microsoft/vscode

Automatically allow `read_file` access to Copilot terminal-output artifacts

Open
#333,709 2 comments 0 reactions 1 assignee Assigned to @meganrogge View on GitHub
chat-terminal
Dominant language
TypeScript
Stars
193k
Forks
42.4k
PR merge metrics
PR metrics pending

Description

When the built-in `run_in_terminal` tool produces output beyond its inline size limit, VS Code writes the full result to a file under:
```
/copilot-terminal-output/copilot-terminal-output-.txt
```

The truncated tool result instructs the agent to use `read_file` or `grep_search` to inspect the complete output. However, this directory is outside the workspace and is not currently an automatic exception in the file-tool access checks, so using `read_file` will require an external-file confirmation (unless manually added to `github.copilot.chat.additionalReadAccessPaths`).

Image

Image

Note that `read_file` policy is distinct from the terminal sandbox policy, resolved in #330797. The copilot-terminal-output directory is now automatically registered as a read-only sandbox root, so a sandboxed terminal command can inspect it. The direct read tool should have equivalent access for these VS Code-created, session-managed files.

### Rationale
The agent is explicitly told that the full output was saved to this file and that it should inspect it with file-reading tools. Requiring a second confirmation interrupts that intended recovery flow. Since VS Code created the file specifically for the current Copilot terminal session, it is comparable to existing automatic exceptions for internal session resources, debug logs, transcripts, and narrowly recognized Copilot SDK `copilot-tool-output-*.txt` spill files (`isCopilotSdkToolOutputTempFile` code-path).

### Related Issues

- [#313837](https://github.com/microsoft/vscode/pull/313837): added auto-approval for Copilot SDK spill files (distinct from the terminal output spill files discussed here)
- [#330797](https://github.com/microsoft/vscode/issues/330797): added copilot-terminal-output as a read-only path for the terminal sandbox.
- [#329724](https://github.com/microsoft/vscode/issues/329724): tracks structured SDK support for large shell-output artifact paths.
- [#293386](https://github.com/microsoft/vscode/issues/293386): introduced github.copilot.chat.additionalReadAccessPaths for user-configured external read locations.

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.