Repository navigation
feat(agent): the project map says which dependencies are missing and where the agent may work - #4537
Conversation
…where the agent may work Agents repeatedly discovered, one failed step at a time, that the project could not import here and that paths outside the workspace are denied. The map now compares the manifest's declared runtime dependencies with what the python on PATH has installed (nothing from the project is imported or run), and names the folders the agent may use.
|
Verdict: Request changes The idea is good and the benchmark backs it: telling the agent up front which dependencies are missing and which folders it may use cut "Access denied" hits from about 8 to 0. Two problems need fixing before merge:
One smaller accuracy point: the dependency check skips user-installed packages ( Real-world evidenceN/A — no evidence bundle for this run. The change affects only the agent's system prompt, with no CLI, API or UI output to capture. The PR's SWE-bench table is the behavioural evidence. Apart from that table, this verdict rests on static review. 🔍 Technical details🔴 🟡 Missing-deps line goes stale after an install (
Please add a test that flips the probe result while keeping the same fingerprint. 🟡 🟢 Work-roots line is stronger than the validator ( 🟢 Unguarded read ( Strengths
|
…nd on Python 3.10 Addresses review on the project-map dependency check. Agents on Python 3.10 no longer fail to import, since the TOML reader falls back to tomli. The "NOT installed" line now clears once the packages are installed: the probe runs outside the map cache and is re-asked whenever one of the interpreter's search paths changes. The probe now sees user-site packages and PYTHONPATH like the agent's shell does, while running from an empty folder so no project module can shadow its imports. The work-roots line says "without asking" and is capped, and unreadable setup.py/requirements.txt files are logged instead of aborting the map. Also merges origin/main.
… prompt The missing-dependency line re-checks after an install, so it changed the system prompt mid-session, and a granted folder changed the work-roots line the same way. Either change makes a local model re-read the whole conversation (amd#4698). The dependency line now rides in the user turn, next to the indexed-documents line, so it stays current. The work roots are fixed at the first render; a later grant still applies, only the line lags it. A flagship test runs two turns with an install and a grant between them and checks the prompt does not change while the turn carries the update.
Agents found out one failed step at a time that the project could not import here and that paths outside the workspace are denied: pip probes, site-packages hunts,
cd C:\and similar. GAIA now states both up front. Each turn says which runtime dependencies the manifest declares are missing from thepythonon PATH, with nothing from the project imported or run, and the project map names the folders the agent may use. The dependency line rides in the turn, not the system prompt: an install changes it mid-session, and a changed system prompt makes a local model re-read the whole conversation (#4698). The table below was measured with the line in the system prompt.Test plan
python -m pytest tests/unit/agents/test_project_deps.py tests/unit/test_project_map.py hub/agents/gaia/python/tests/test_prompt_prefix_stability.py hub/agents/gaia/python/tests/test_prompt_prefix_stability_project_deps.py: an install and a folder grant between two turns leave the system prompt byte-identical, and the second turn says the dependencies are installed (fails before the fix)pyproject.tomlnames an uninstalled package, the user turn carries[Python dependencies NOT installed forpython: …]gaia eval agent --category gaia_core