fix(config): enforce allow_edit_existing_files restriction in tool selection#389
Merged
RyderFreeman4Logos merged 1 commit intomainfrom Mar 10, 2026
Merged
Conversation
…lection (#388) Wire up the existing but unused `infer_task_edit_requirement()` heuristic to the tool selection pipeline. When a prompt indicates editing intent (fix, implement, refactor, etc.), tools with `allow_edit_existing_files = false` are now filtered out during tier-based selection. Three changes: - `resolve_tool_and_model()` accepts `needs_edit` and forwards it to `resolve_tier_tool_rotated()` (was hardcoded `false`) - New `resolve_tier_tool_filtered()` replaces the unfiltered fallback, `resolve_tier_tool()` now delegates to it with `needs_edit=false` - `run_cmd_execute` calls `infer_task_edit_requirement()` and passes the result through the strategy resolution chain Closes #388 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
infer_task_edit_requirement()to the tool selection pipelineallow_edit_existing_files = falseare now filtered out when the prompt indicates editing intentresolve_tier_tool_rotated) and fallback (resolve_tier_tool_filtered) paths enforce restrictionsRoot Cause
needs_editwas hardcoded tofalseinresolve_tool_and_model()line 87, soresolve_tier_tool_rotated()never filtered restricted tools. Additionally, the non-rotating fallbackresolve_tier_tool()had no restriction check at all.Changes
run_helpers.rsneeds_editparam toresolve_tool_and_model(), forward to rotationrun_cmd_execute.rsinfer_task_edit_requirement()and pass result to strategy resolverrun_cmd_tool_selection.rsneeds_editthrough all strategy armsconfig.rsresolve_tier_tool_filtered(),resolve_tier_tooldelegates to itrotation.rsconfig_tests_tier.rsresolve_tier_tool_filteredTest plan
Closes #388
🤖 Generated with Claude Code