错误: 文件编辑展开所有选项卡,破坏 Makefile 的缩进与原始内容
作者: 2gg-bit创建于 2026年9月27日更新于 2026年9月27日
Reproduction The file content is build:\n\techo old\n, and str_replace_editor replaces build: with release:. The original code changes the tab at the beginning of the command line to 8 spaces, which breaks the indentation of the Makefile. insert also modifies the existing tabs and the tabs inserted by the content; the undo history also records the expanded text. The reason is that str_replace and insert use expandtabs() for the entire file and editing parameters. This also causes spaces to be incorrectly matched to tabs, which is inconsistent with the requirements of the tool documentation for EXACT/verbatim. view also expands tabs, which makes it impossible to match the original whitespace in a subsequent word-by-word manner. The expected behavior is to preserve the original tabs when reading, matching, editing, and restoring history; only modify the content within the specified range. Preparing to submit the minimum fixes and temporary file regression tests. The original implementation performed 6 local regressions: 5 failed, 1 passed, covering replacing other lines, replacing tab lines, inserting tabs, viewing the original content, rejecting incorrect matching of spaces, and pure text comparison. No external models were invoked. AI disclosure: The issue was analyzed and tested by OpenAI Codex AI and has not yet been reviewed by humans.
内容来源: FoundationAgents/OpenManus