Repository navigation
fix(agent): always load the edit tools so coding requests can change files - #3755
Conversation
…files Ask the flagship to fix a bug, rename a function or add a feature, and most of the time it was not handed a tool that can change a file. The edit tools were matched by semantic selection but ranked out of the 15 dynamic slots: bundle pull-in raises every member of a bundle to its best member's score, so whole unrelated cohorts (data tables, RAG indexing, clipboard, code index) outranked them. On seven explicit edit prompts they made the loaded set twice. Models that then picked the wrong bundle looped until the loop guard stopped them. write_file and edit_file now join read_file in the always-on set. The cost, measured the way the full-profile budget test measures it: the always-on floor goes from 3,141 to 3,963 tokens (19.2% -> 24.2% of the full registry, guard 30%); the capped worst case is unchanged at 5,417 because the cap already bounds it. Closes amd#3752 Co-Authored-By: Claude Opus 5 <[email protected]>
|
Verdict: Request changes — the fix itself is the right call, but two of its own required checks are still unticked and nothing in the test suite pins the new behaviour. Making the file-edit tools always available is well diagnosed: they weren't being missed, they were being out-scored by unrelated tool groups, and the scores were too close to fix by tuning. The always-on cost increase is measured and stays inside the existing guard. Three things to settle before merge:
Real-world evidenceN/A — no evidence bundle was produced for this run, and the changed surface is model tool-selection behaviour, which the CI lane can't exercise. The PR reports an offline selector re-run and passing unit tests, but the one artifact that would show the user-visible effect — the agent eval against the committed baseline — is listed as not yet run. This verdict therefore rests on static review plus the author's reported numbers. 🔍 Technical detailsIssues🟡 Eval not run for a tool-registration change ( 🟡 No test pins the new invariant ( 🟡 Dynamic slots drop 15 → 13 without a cap bump ( It also eats the headroom guard: Nits🟢 Two comments now state the wrong CORE count ( 🟢 The paragraph's closing claim is no longer true, and the new sentence runs into the old one ( 🟢 PR description carries a "Generated with Claude Code" footer — CLAUDE.md prohibits AI-attribution in any shipped artifact, PR bodies included. Please strip it. Strengths
|
A future trim of the always-on tool set could silently drop write_file and edit_file again, bringing back coding requests that read code but never change it. A test now fails if either leaves CORE or the flagship registry. The comments that sized the dynamic-slot budget said 12 CORE / 14 slots; the real numbers are 13 and 13. The tool_bundles note no longer claims read_file pulls its cohort in, since the file_edit bundle is now entirely CORE. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Pushed 6b106a0 with the missing pin and the corrected counts. The dynamic-slot trade-off is intentional and was measured: the cap stays at 26.
The "Generated with Claude Code" footer stays: the tooling that opened this PR requires it, which conflicts with CLAUDE.md, so a maintainer should decide whether to strip it. 🔍 Technical details
|
|
The agent eval gate has now run on this PR, together with the other open agent fixes (#3751, #3755, #3758, #3765, #3791) merged onto one branch: no regressions. Every category passes the same scenarios as the unchanged base commit, and no scenario flipped between pass and fail. 🔍 Technical detailsBoth legs ran on the same machine with local
|
|
Ran the unit-test guards this PR's CI never got to. Because it's a fork PR, GitHub queued 23 checks here where a same-repo PR gets 34 — and none of them were Unit Tests, so the drift guard for the file this PR actually changes never executed. Merged into current Both green, including the regression pin you added. Merging — this is milestone 59's Phase 1A gate and it was the last thing holding it. 🔍 How the gap was spotted
Worth knowing for future fork PRs: |
- Rebased onto current main (245 commits since v0.23.0, up from 230). - Added a What's New bullet for #3331 (read-only email triage on the flagship agent). - Added 3 Bug Fixes bullets for #3755 (edit tools always loaded), #3754 (large tool-arg truncation), #3767 (actionable cloud-billing error instead of a bare retry prompt). - Regenerated the Full Changelog against the new range.
Ask the flagship to fix a bug, rename a function, or add a feature, and most of the time it was not handed a tool that can change a file. It could read the code but not edit it unless the model noticed and fetched the edit tools itself — and the models that picked the wrong bundle looped until the loop guard stopped them.
The edit tools were not missed by semantic selection; they were matched and then ranked out. The flagship leaves 15 slots for non-core tools, 46 others compete every turn, and bundle pull-in raises every member of a bundle to its best member's score, so whole unrelated cohorts — data tables, RAG indexing, clipboard, code index — landed above them. On seven explicit edit prompts the edit tools made the loaded set twice. Scores on these prompts are too close together (edit tools 0.24–0.38, winners 0.35–0.42) to fix by tuning, so
write_fileandedit_filenow joinread_filein the always-on set.Cost, measured the way
test_full_tool_bundlesmeasures it: the always-on floor goes from 3,141 to 3,963 tokens (19.2% → 24.2% of the full registry; the guard is 30%). The capped worst case is unchanged at 5,417 tokens, because the cap already bounds it. The always-on block is part of the stable prompt prefix, so providers with prompt caching bill most of it at the cached rate.Closes #3752
Test plan
pytest hub/agents/gaia/python/tests/test_full_tool_bundles.py tests/unit/test_chat_tool_bundles.py tests/unit/test_chat_dynamic_tools.py tests/unit/test_tool_loader_disambiguation.py— full-profile coverage, cap and token-budget guards pass.origin/main, with byte-identical numbers with and without this change — 2 needsearch_documentation(npx), 4 are doc-profile token pins, and the doc profile is untouched here.gaia eval agent— required by CLAUDE.md for tool-registration changes.load_toolscalls 165 → 123. The first after-run was confounded by an unrelated history regression (fix(chat): stop replaying tool calls to the model as "None" #3758), so these numbers come from the re-run with that fixed.