Skip to content

fix(agents): Gemini's file tools read the task directories /app and /tmp/data - #882

Merged
psinghal20 merged 2 commits into
mainfrom
pratyush/gemini-include-task-dirs
Nov 23, 2026
Merged

psinghal20 merged 2 commits into
mainfrom
pratyush/gemini-include-task-dirs

Conversation

@psinghal20

@psinghal20 psinghal20 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Problem. gemini-cli's file tools refuse paths outside its workspace (/workspace), so a task's files under /app (e.g. /app/handover) or in /tmp/file_artifacts (where load_artifact puts files in an agent by default) fail read_file with "Path not in workspace", and a binary file there never reaches the model.

Change. Each run's system settings set context.includeDirectories to whichever of /app, /tmp/data and /tmp/file_artifacts exist (TASK_DIRS). A missing directory is left out, since the CLI fails to start on one; the check runs each turn. The snapshot changelog's roots are unchanged.

Validation. Gemini unit tests pass, with a new test for the included directories. In a container with a PDF at /app/handover/report.pdf, and again at /tmp/file_artifacts/report.pdf, and a mock model calling read_file on it: without this change the read returns "Path not in workspace"; with it the read returns the file and its bytes reach the model.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable new issues were found.

Summary

Gemini’s file tools can read existing task directories outside the workspace.

  • Gemini can read task files outside its workspace.

Reviews (2) · Last reviewed commit: "fix(agents): Gemini's file tools also re..." · Reviewed by Greptile

…tmp/data

gemini-cli's file tools refuse paths outside its workspace, /workspace, so a task's
files under /app (as /app/handover) failed read_file with "Path not in workspace", and a
binary file there never reached the model. Each run's settings now include whichever of
/app and /tmp/data exist (the CLI fails to start on a missing included directory), the
directories the snapshot changelog already treats as the task's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@psinghal20
psinghal20 requested a review from a team as a code owner November 23, 2026 10:38
@earakely-scale

Copy link
Copy Markdown
Collaborator

🤖 Automated Claude routine — Env Pod PR Context Review. This is a bot, not Edgar Arakelyan; not a human review.

Context from outside this diff, on where TASK_DIRS came from vs. where task files actually land.

The PR derives TASK_DIRS = ("/app", "/tmp/data") (src/agent_env/agents/agents/gemini/gemini_config.py:33) from the snapshot changelog's capture roots. Those roots exist to reconstruct the writable layer, which is a different question from "where does a task hand this agent files" — and the step whose whole job is the latter uses a third default:

  • src/agent_env/task_step/task_steps/load_artifact.py:527 — a load_artifact targeting an agent (agent_name set) with a FileArtifactUniverse/FileArtifact defaults its destination to /tmp/file_artifacts.
  • :652 — same default on the downloads path, which also resolves against context.deployed_agents.

Neither is under /app or /tmp/data, and Gemini's workspace is /workspace (a2a_server.py:120), so a task that loads file artifacts into the Gemini agent without naming destination_path should still hit the "Path not in workspace" failure this PR fixes for /app.

Might be deliberate — if the tasks in view always pass an explicit destination_path under /app, nothing here applies. Flagging in case the default path was simply out of view when the constant was assembled.


Generated by Claude Code

…artifact's default for an agent

A FileArtifact, file universe or URL that load_artifact puts in an agent without a
destination_path lands in /tmp/file_artifacts, which the included directories left out,
so its files still failed read_file with "Path not in workspace". The snapshot changelog
keeps its own roots: they say what to rebuild of the agent's writable layer, not where
tasks hand it files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@psinghal20
psinghal20 merged commit 936d3f9 into main Nov 23, 2026
35 of 36 checks passed
@psinghal20
psinghal20 deleted the pratyush/gemini-include-task-dirs branch November 23, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants