Repository navigation
fix(agent): offer the shell when the user asks for it by name - #4728
Conversation
|
Verdict: Approve with suggestions. Merge once the flagship eval comes back clean. When a user asks for the shell outright ("use your shell tool to run pwd") or asks for the working directory, the agent is now always offered the shell. Before, the 29-tool cap could drop it and the agent guessed the directory instead. The new tier slots into the loader's existing cap and eviction rules, and the old SKILL logic moved into a shared helper without changing what it does. I found no correctness bugs.
Real-world evidenceN/A: no evidence bundle was produced. This changes agent tool selection, so real-inference proof belongs to the flagship eval on the strix-halo lane, which the PR lists as pending. The PR description reports a real-embedder check: the pwd prompt now selects both shell tools. That result wasn't reproduced here. Everything else in this verdict comes from reading the code, and pytest wasn't available on this runner, so I didn't re-run the tests either. 🔍 Technical details🟡 Important
🟢 Minor
Strengths
|
"Use your shell tool to run pwd" got an answer guessed from nowhere: about 90 of the flagship's tools cleared the semantic threshold for that message, the 29-tool cap decided, and run_shell_command (score 0.40) was skipped in favour of file browsers. The agent never had the shell to call. Tools the user's message explicitly asks for — a tool name written out, or a request only the shell can answer (pwd, working directory, "run git status", "in the terminal") — are now admitted ahead of recalled-skill and semantic candidates, with the same cap and eviction rules as the skill tier.
… test test_shell_is_offered_when_the_user_asks_for_it built its GaiaAgent without dynamic_tools=True, so the loader was never constructed and reset_session() crashed on None in CI. tests/unit/test_chat_tool_requests.py also needed an entry in util/test_lane_allowlist.yml's module_skips — it importorskips gaia_agent_chat, which the generic unit-tests lane doesn't install, and the lane-coverage gate failed without the allowlist reason.
972a4b2 to
bb61208
Compare
The allowlist already pointed at test_chat_agent.yml, but the file was never added to its pytest invocation or path triggers, so check_test_lane_coverage.py flagged the entry as stale.
"Use your shell tool to run pwd" made the flagship guess the directory instead of running the command (
gaia_shell/shell_pwd_basicfails 2/2 on main). The shell was never offered. About 90 tools matched the message semantically, the 29-tool cap decided, andrun_shell_commandlost its slot to file browsers. Now a tool the user names, or a request only the shell can answer (pwd, working directory, "run git status", "in the terminal"), goes into the tool set ahead of semantic ranking.This brings back a narrow keyword signal, which the tool-loader plan had removed on purpose. It only adds tools and only fires on explicit asks; the plan doc now says why.
Test plan
pytest tests/unit/test_chat_tool_requests.py tests/unit/test_tool_loader_selection.py hub/agents/gaia/python/tests/test_full_tool_bundles.pypasses. The flagship test fails with the classifier disabled.test_core_and_bundles_cover_the_flagship_registry_exactlyandtest_optional_tools_are_present_on_a_full_installfail locally only because Playwright isn't installed; they fail on main too.python util/lint.py --black --isort --flake8is cleanrun_shell_commandandget_shell_state(before: neither,run_shell_commandskipped at the cap)eval_flagship.yml:gaia_shell/shell_pwd_basicpasses, and no category regresses againsttests/fixtures/eval_baselines/gaia-flagship/(especiallytool_selectionandgaia_shell)🔍 Technical details
REQUESTEDtier inToolLoader.select(requested_tools=...). It is admitted after CORE and ahead of SKILL. It reuses the SKILL admission loop (now_admit_exact), so it follows the same cap, LRU eviction and per-turn protection. Its log keyrequestedis emitted only when non-empty.gaia_agent_chat.tool_requests.requested_tools. It matches an underscored registry name written out, or a shell/working-directory phrase. "Terminal" and "bash" count only when they name the place something runs ("in the terminal"), so "the airport terminal" doesn't fire.get_shell_state0.69,run_shell_command0.40, threshold 0.20, cap 29.