Skip to content

fix(tools): prevent token amplification and hang on large file edit#1692

Open
1688mengdie wants to merge 2 commits into
GCWing:mainfrom
1688mengdie:pr/fix-1650-edit-tool-token
Open

fix(tools): prevent token amplification and hang on large file edit#1692
1688mengdie wants to merge 2 commits into
GCWing:mainfrom
1688mengdie:pr/fix-1650-edit-tool-token

Conversation

@1688mengdie

Copy link
Copy Markdown

概述

修复 Edit 工具在大文件编辑时的 token 膨胀和挂起问题。

根因

\ ind_actual_string()\ 对全文做扫描匹配,当文件超过 500 行时导致指数级候选组合,引发 token 放大和工具调用挂起。

修复

文件 > 500 行时跳过全文扫描,仅做直接匹配。

验证

  • cargo check -p tool-runtime --offline 通过

Closes #1650
Ref: #1674

BitFun Research 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Edit tool: token amplification and hang when editing large files with stale read-state cache

1 participant