fix(tools): prevent token amplification and hang on large file edit#1692
Open
1688mengdie wants to merge 2 commits into
Open
fix(tools): prevent token amplification and hang on large file edit#16921688mengdie wants to merge 2 commits into
1688mengdie wants to merge 2 commits into
Conversation
added 2 commits
July 23, 2026 04:05
8 preset team configurations (standard/quick/parallel/single/review/audit/plan/custom). Enables one-click multi-agent legion deployment from UI. @wsp1911 Ref: GCWing#1674
Skip full-file scan (find_actual_string) for files > 500 lines to avoid exponential candidate generation and hung tool calls. Closes GCWing#1650
This was referenced Jul 22, 2026
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.
概述
修复 Edit 工具在大文件编辑时的 token 膨胀和挂起问题。
根因
\ind_actual_string()\ 对全文做扫描匹配,当文件超过 500 行时导致指数级候选组合,引发 token 放大和工具调用挂起。
修复
文件 > 500 行时跳过全文扫描,仅做直接匹配。
验证
Closes #1650
Ref: #1674