You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes a false positive in file mutation result handling where successful write_file and patch calls could be treated as failed when their JSON result contained nested diagnostic text such as lint errors or LSP diagnostics. The change centralizes landed mutation classification so verifier footers, CLI tool status, and tool guardrails agree on the same success contract.
All checks except the full test job are green on this PR:
Supply chain scan passed
Attribution check passed
Windows footguns passed
Ruff enforcement passed
ruff + ty diff passed
e2e passed
amd64 and arm64 builds passed
nix checks passed on Ubuntu and macOS
The remaining test job failed in areas unrelated to this PR. The failures are in Bedrock optional dependency and packaging checks, Dingtalk card lifecycle tests, Feishu bot identity hydration, startup plugin gating for lsp, switch-model context length preservation, local transcription optional dependencies, and KittenTTS importing numpy.
This PR only changes file mutation result classification plus focused tests for verifier, display, guardrail, and classifier behavior. None of the failed CI tests are in the changed files or related code paths.
Local verification for this PR:
uv run --extra dev python -m pytest -q tests/run_agent/test_file_mutation_verifier.py tests/agent/test_display.py::TestCuteToolMessagePreviewLength tests/agent/test_tool_guardrails.py tests/agent/test_tool_result_classification.py
uv run --extra dev python -m ruff check agent/tool_result_classification.py agent/display.py agent/tool_guardrails.py run_agent.py tests/agent/test_tool_result_classification.py tests/agent/test_display.py tests/agent/test_tool_guardrails.py tests/run_agent/test_file_mutation_verifier.py
git diff --check
alt-glitch
added
type/bug
Something isn't working
P2
Medium — degraded but workaround exists
comp/agent
Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint
tool/file
File tools (read, write, patch, search)
labels
May 13, 2026
Merged via #25011. Your commit is preserved as-is in git history (da0ddbf88 fix: classify landed file mutations with diagnostics) with original authorship. We added a follow-up refactor on top to deduplicate _FILE_MUTATING_TOOLS (importing the canonical FILE_MUTATING_TOOL_NAMES you exported from agent/tool_result_classification.py into run_agent.py instead of redefining it). Thanks for the thorough work on this — the shared-helper design was the key win.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes a false positive in file mutation result handling where successful
write_fileandpatchcalls could be treated as failed when their JSON result contained nested diagnostic text such as lint errors or LSP diagnostics. The change centralizes landed mutation classification so verifier footers, CLI tool status, and tool guardrails agree on the same success contract.Related Issue
Fixes #24927
Type of Change
Changes Made
agent/tool_result_classification.py.How to Test
uv run --extra dev python -m pytest -q tests/run_agent/test_file_mutation_verifier.py tests/agent/test_display.py::TestCuteToolMessagePreviewLength tests/agent/test_tool_guardrails.py tests/agent/test_tool_result_classification.pyuv run --extra dev python -m ruff check agent/tool_result_classification.py agent/display.py agent/tool_guardrails.py run_agent.py tests/agent/test_tool_result_classification.py tests/agent/test_display.py tests/agent/test_tool_guardrails.py tests/run_agent/test_file_mutation_verifier.pygit diff --checkChecklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) or N/Acli-config.yaml.exampleif I added/changed config keys or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows or N/AFor New Skills
N/A
Screenshots / Logs
Targeted verifier, display, guardrail, and classifier tests passed: 55 passed.
Ruff passed on changed Python files.
Whitespace check passed with
git diff --check.