Repository navigation
feat(tools): an edit to a Python function lists the project code it reaches - #4535
Conversation
…eaches A signature change now reports the function's callers elsewhere in the checkout, and a method edit reports the other classes defining that method. In SWE-bench runs the agent missed a second caller and a sibling manager because it searched only the folder it was working in.
|
Verdict: Approve with suggestions After a successful Python edit, the result now includes a short list of the other places in the project that call or redefine the changed function. That way the agent stops fixing one caller and missing the rest. The idea is sound and the SWE-bench numbers back it up. Two gaps are worth closing before merge:
Real-world evidenceN/A: no evidence bundle was produced for this run. This changes the content of agent tool results and has no CLI, REST or UI surface. The PR description gives a 6-task SWE-bench comparison and a trace excerpt as behavioral evidence. The verdict rests on static review, plus a local check of the helper against a scratch git repo. 🔍 Technical details🟡 Relative paths never find the git root ( 🟡 The caller search has no guard against common names ( 🟢 A crash in the impact pass reports a completed write as failed ( 🟢 Regex portability ( 🟢 No test through a tool Strengths
|
Calling edit_impact() with a relative Path (as edit_python_file and replace_function do) never found the git root, so the impact note silently never appeared from a non-repo-root cwd. Resolve the path before walking parents. Also skip dunder names in the signature-changed scan, matching the guard the sibling-method scan already has — an __init__ signature change was listing every unrelated super().__init__() call in the project.
…PR (amd#4562) Every open PR fails the Windows and macOS unit-test smoke jobs on code that is already on main. Those jobs only run on PRs, so main looks green while each PR inherits two red checks. After this, the smoke jobs only fail on what a PR actually changed. - **macOS:** the edit-impact check (amd#4535) found no callers of a changed function, because macOS `git grep -E` has no `\b` or `\s`. The patterns now use POSIX classes, so this is a real bug fix for macOS users, not just a test fix. - **Windows:** a store test asserted POSIX file mode `0600`. Windows has no mode bits, and the store's Windows ACL is already tested in the same file. ## Test plan - [ ] CI: "Unit Tests (macOS smoke)" passes, including `tests/unit/agents/test_edit_impact.py` - [ ] CI: "Unit Tests (Windows smoke)" passes, including `tests/unit/engineering/test_store.py` - [x] Locally on Windows: both files pass (25 tests); the new patterns match `levels(` and `def levels (` and skip `alevels` - [x] `python util/lint.py --black --isort`
When the agent changed a function's signature or a method, it fixed the place it was looking at and missed the same code elsewhere: a second caller in another folder, or a sibling class defining the same method. Now every Python edit result carries an
impactnote listing the other callers of a changed signature and the other definitions of an edited method, found bygit grepacross the checkout. On a 6-task set of hard SWE-bench Verified problems (DeepSeek V4.1 Flash), GAIA solved 5/6 with the note against 2/6 and 3/6 on two runs without it. It solved django-16256, which every earlier run had failed, Claude Code included.The traces show the note doing the work. On matplotlib-24870 it listed
tri/_tricontour.py:77as a caller of the changed signature, and GAIA edited that line three steps later. It is silent for non-Python files, for unparsable code, and outside a git checkout. It adds no text to the system prompt.Test plan
python -m pytest tests/unit/agents/test_edit_impact.py tests/unit/agents/test_file_edit_semantics.pyedit_fileresult names that caller