Skip to content

Install tree in the Docker image so the agent sees its project structure - #6

Open
KTanmay1 wants to merge 1 commit into
DeepSoftwareAnalytics:mainfrom
KTanmay1:fix/install-tree-in-image
Open

Install tree in the Docker image so the agent sees its project structure#6
KTanmay1 wants to merge 1 commit into
DeepSoftwareAnalytics:mainfrom
KTanmay1:fix/install-tree-in-image

Conversation

@KTanmay1

@KTanmay1 KTanmay1 commented Aug 13, 2026

Copy link
Copy Markdown

Problem

ReactTranslationAgent.get_project_tree (RepoTransAgent/run.py:246) shells out to tree:

result = subprocess.run(["tree", str(self.working_path), "-L", "3"], ...)

but docker/Dockerfile never installs it — grep -c tree docker/Dockerfile returns 0 on main.

The failure is silent. subprocess.run raises FileNotFoundError before returning, so the find fallback under the returncode == 0 check is unreachable, and the outer handler converts it to a string that is passed to the model as its observation:

Error getting project structure: [Errno 2] No such file or directory: 'tree'

Evidence

A 20-iteration C → Python run (antirez_smaz) on an image built from your docker/Dockerfile's Python 3.11 stanza — same apt-get install list, Java/.NET/Go/Rust/Node layers omitted as that task never touches them — produces the error string in all 20 turns, with no turn receiving a file listing.

As a control, the same agent run against an image that does install tree receives a real listing in all 20 turns. So the behaviour tracks the missing package and nothing else.

Why it matters beyond a log line

get_project_tree is the only channel telling the agent which files currently exist, and slide_window_conversation (generator.py:72) retains only the previous turn — so that listing is effectively the agent's record of its own progress. With it replaced by an error string, the agent re-derives project state from scratch each turn.

Fix

Add tree to the existing apt-get install list.

This changes what the agent sees, and therefore scores. Noting it explicitly for the same reason as #5.

`ReactTranslationAgent.get_project_tree` (RepoTransAgent/run.py:246)
shells out to `tree`, but docker/Dockerfile never installs it.

The failure is silent. `subprocess.run(["tree", ...])` raises
FileNotFoundError before returning, so the `find` fallback below the
`returncode == 0` check is unreachable, and the outer handler turns it
into a string that is fed to the model as the observation:

    Error getting project structure: [Errno 2] No such file or directory: 'tree'

This appears in every turn of every run. It matters more than a log line:
get_project_tree is the only channel telling the agent which files
currently exist, and slide_window_conversation (generator.py:72) keeps
only the previous turn, so that listing is the agent's working record of
its own progress.

Confirmed across two full 20-iteration runs (C -> Python, Python -> TS);
`grep -c tree docker/Dockerfile` returns 0 on main.

This changes what the agent sees, and therefore scores.
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.

1 participant