Configure Gemini to allow reading /tmp/gh-aw/ outside workspace#17612
Configure Gemini to allow reading /tmp/gh-aw/ outside workspace#17612pelikhan merged 2 commits intocopilot/update-parser-log-javascriptfrom
Conversation
…ories in settings.json Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Updates the generated Gemini CLI settings so the agent can read MCP payload files written by the gateway under /tmp/gh-aw/, avoiding “Path not in workspace” errors.
Changes:
- Extend
.gemini/settings.jsongeneration to setincludeDirectoriesto["/tmp/gh-aw/"].
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Allow Gemini CLI to read files from /tmp/gh-aw/ (e.g. MCP payload files) | ||
| .includeDirectories = ["/tmp/gh-aw/"] |
There was a problem hiding this comment.
Granting read access to all of /tmp/gh-aw/ is broader than necessary; it increases the blast radius if any sensitive files end up in that directory. Consider narrowing this to the specific payload directory (e.g. /tmp/gh-aw/mcp-payloads/) and/or gating it behind an explicit env/config toggle so it’s only enabled in environments that need it.
| # Allow Gemini CLI to read files from /tmp/gh-aw/ (e.g. MCP payload files) | |
| .includeDirectories = ["/tmp/gh-aw/"] | |
| # Allow Gemini CLI to read MCP payload files from a specific subdirectory | |
| .includeDirectories = ["/tmp/gh-aw/mcp-payloads/"] |
| # Allow Gemini CLI to read files from /tmp/gh-aw/ (e.g. MCP payload files) | ||
| .includeDirectories = ["/tmp/gh-aw/"] |
There was a problem hiding this comment.
This overwrites any existing includeDirectories that may already be present in the incoming config. To avoid clobbering user/configured values, merge with the existing array (defaulting to []) and de-duplicate instead of assigning a new array.
| # Allow Gemini CLI to read files from /tmp/gh-aw/ (e.g. MCP payload files) | |
| .includeDirectories = ["/tmp/gh-aw/"] | |
| # Allow Gemini CLI to read files from /tmp/gh-aw/ (e.g. MCP payload files), | |
| # preserving any existing includeDirectories and avoiding duplicates | |
| .includeDirectories = ((.includeDirectories // []) + ["/tmp/gh-aw/"] | unique) |
Gemini CLI's
read_filetool restricts paths to the workspace and a project temp dir by default. When an MCP tool response is too large, the gateway saves the payload to/tmp/gh-aw/mcp-payloads/and instructs the agent to read it — but Gemini blocks this with "Path not in workspace".Changes
actions/setup/sh/convert_gateway_config_gemini.sh: AddsincludeDirectoriesto the generated.gemini/settings.json, allowing Gemini CLI to read files under/tmp/gh-aw/{ "mcpServers": { ... }, "includeDirectories": ["/tmp/gh-aw/"] }💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.