Skip to content

chore(agents): drop tool names that do not exist and dead code in the agent framework - #7085

Merged
kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:kalin/agent-framework-dead-names
Nov 11, 2026
Merged

kovtcharov-amd merged 3 commits into
amd:mainfrom
kovtcharov:kalin/agent-framework-dead-names

Conversation

@kovtcharov

Copy link
Copy Markdown
Contributor

The agent framework's confirmation, risk and document-tool tables listed tools that don't exist, such as run_cli_command and query_indexed_documents. The tables looked complete while describing tools removed or renamed long ago, which hides real drift. A second, unused path-permission cache also wrote path_permissions.json on every session start, alongside the real tool grants. This removes the phantom names, corrects one to the tool it was meant to match, and deletes the dead cache and other uncalled code. Confirmation behaviour for real tools is unchanged, and old session files still load.

Closes #7072

Test plan

  • Tests touching the edited modules, the process-safety ratchet, import-every-module and registry tests: 7,275 passed, 67 skipped.
  • Flagship package tests: 1,300 passed. 3 failed (test_full_tool_bundles ×2, test_manifest_tools_count_matches_real_registry); they fail identically without this change, because the browser tools aren't installed in the local environment.
  • New tests: an old session file that still has path_permissions loads, and an existing path_permissions.json is left on disk.
  • TUI: go build, go vet and the components tests pass. Agent UI: tsc --noEmit is clean and the permission-prompt tests pass (68).
🔍 Technical details
Name Outcome
run_cli_command Removed from the Python tables, the TUI mirror, sse_translation.py and PermissionPrompt.tsx. Its mixin went in #2995; run_shell_command and wait_for_condition were already in every table.
query_indexed_documents, index_documents, session_findings, read_document Removed. index_document already covers the prefix match.
index_dir Corrected to index_directory, the real tool it matched by prefix.
run_tests Removed from chunk_index.py. Kept in verification.py, where the docs list it as a recognised test-run name.
  • gaia_agent/session.py: validate_path, validate_directory, clear_path_permissions and the path_permissions.json load/save are gone.
  • Also removed: unused audio refine helpers, SkillDelta.is_overlaid, STATUS_ORPHANED, two unused snapshot defaults, and the unreachable PyPDF2 fallback (pypdf>=6.20 is pinned).
  • Kept: registry.py's warning for YAML-only agents, which a user with an old agent folder still sees.
  • No tool docstring or prompt changed, so no eval category is affected.

… agent framework

The confirmation, risk, grant and document-tool tables named tools that were removed or renamed, and an unused path-permission cache was still loaded from disk on every SessionManager start, so the tables looked complete while hiding real drift.

- run_cli_command, query_indexed_documents, index_documents, session_findings, read_document and run_tests (chunk_index) are removed; index_dir becomes the real index_directory it was prefix-matching.
- run_tests stays in verification.py: it is a documented name classifier for third-party tools, alongside build/lint/typecheck.
- SessionManager no longer reads path_permissions.json and ChatSession drops the field; old session files carrying it still load, and existing path_permissions.json files are left on disk.
- Dead audio refinement helpers, SkillDelta.is_overlaid, STATUS_ORPHANED, unused file-snapshot defaults and the PyPDF2 fallback in filesystem_tools are deleted.

Closes amd#7072
@github-actions github-actions Bot added documentation Documentation changes tests Test changes agents tui Go terminal UI (gaia-tui) labels Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Verdict: Approve with suggestions

This is a safe cleanup. It removes tool names that no real tool uses from the confirmation, risk and document-tool tables. It also deletes an unused path-permission cache and some helpers nothing calls. I checked whether dropping run_cli_command from the confirmation and shell-scope lists could let anything skip a prompt. It can't, because no tool by that name is registered anywhere in the tree. One table entry is also fixed so it matches the real indexing tool, and old session files still load. The only leftover is one more mention of the removed tool in the same plan doc.

Real-world evidence

N/A: no evidence bundle was produced for this run. The change only removes names from internal tables plus dead code, and no command, endpoint or screen changes behaviour for a real tool. The verdict rests on static review and the author's reported test runs (Python, Go components tests, Agent UI permission-prompt tests).

🔍 Technical details

Issues found

🟢 One stale run_cli_command left in the plan doc (docs/plans/security-model.mdx:736). The PR removes it from the tier table at line 139, but MESSAGING_DENIED_TOOLS in §12.2 still lists it. Swap it for run_shell_command so the deny-list example doesn't name a tool that doesn't exist:

    "run_shell_command",

What I verified

  • git grep run_cli_command at the PR head finds nothing outside that plan doc. No @tool registers it, so removing it from TOOLS_REQUIRING_CONFIRMATION, SHELL_TOOLS / _SHELL_TOOLS, the TUI risk tier, title and warning maps, COMMAND_SUMMARY_TOOLS (Python and TSX) can't open a gate for a real tool.
  • index_directory is a real tool (rag_tools.py:2673), so the _INDEX_TOOLS correction makes the planning-phrase check match it exactly. query_indexed_documents, index_documents (as a tool), session_findings and read_document (as a tool) are not registered. read_document is just a helper in document_text.py, and the remaining hits are eval fixture prose and scenario YAML keys.
  • Nothing calls validate_path, validate_directory, clear_path_permissions, PathPermission, the audio refine helpers, is_overlaid, STATUS_ORPHANED or the snapshot defaults anywhere. The imports left in session.py (asdict, datetime, Path) and audio_tools.py (re) are all still used.
  • ChatSession.from_dict drops the legacy path_permissions key, so a session written by an older release loads without a TypeError. The new test covers this.
  • The test swaps in test_console_tool_confirmation.py and test_skill_binary_grants.py (run_cli_command → wait_for_condition) still test what they were meant to: a real shell tool keeps its scoped grant and the gate still fires.

Strengths

  • The backward-compat tests are useful: an old session file still loads, and an existing path_permissions.json is left alone on disk.
  • Python, TUI and Agent UI copies of the same lists change together, so all three still agree.
  • Removing the unreachable PyPDF2 fallback in filesystem_tools.py keeps the actionable missing_package_hint error, so it still fails loudly.

@kovtcharov-amd
kovtcharov-amd added this pull request to the merge queue Nov 11, 2026
Merged via the queue into amd:main with commit f71a75a Nov 11, 2026
111 checks passed
@kovtcharov-amd
kovtcharov-amd deleted the kalin/agent-framework-dead-names branch November 11, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents documentation Documentation changes tests Test changes tui Go terminal UI (gaia-tui)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(agents): drop tool names that do not exist and dead code in the agent framework

2 participants