search_files can substitute the wrong line when matched text contains :number:
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 75/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- devtools, testing-qa
调研方向
查看 search_files 函数及其对 grep 输出的正则表达式解析。问题出在适配器错误解释了匹配文本中的 :number: 序列。首先找到 grep 结果被处理的位置,并识别正则表达式模式。使用提供的示例文件进行测试以查看替换错误。通过确保正确的行号和文本被保留来验证修复。
由索引模型根据 Issue 内容生成。
描述
What happened?
search_files can return the wrong source text when a matched line itself contains another :<number>: sequence.
For example, if line 1 is:
src/example.ts:42: build failed
the native grep tool correctly returns:
many.log:1: src/example.ts:42: build failed
but the Step-facing search_files result can become:
many.log:1: src/example.ts:42: UNRELATED_LINE_42
The adapter reparses rendered grep output with a greedy path:line:text regex, mistakes the later :42: for the real line number, then reloads line 42 from the file. Timestamp-shaped text such as 12:34: reproduces the same problem; if the false line number is past EOF, the visible result can become (no matches) while the details still report one match.
I reproduced this on clean main @ f113768 with the built-in tool profile and project-native Vitest, without external extensions.
Steps to reproduce
- Create a 42-line file where line 1 is
src/example.ts:42: build failedand line 42 isUNRELATED_LINE_42. - Run
search_filesforbuild failedon that file. - The native grep result contains the correct line-1 text.
- The Step-facing result substitutes the contents of line 42.
Expected behavior
search_files should preserve the native match path, line number, and matched text without reinterpreting delimiter-like text inside the match.
Version
main @ f113768 / @step-harness/coding-agent 0.84.4
- 主要语言
- TypeScript
- 星标
- 850
- 派生
- 62
- 平均合并
- 1 天 10 小时
- 30 天内合并 PR
- 51
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stepfun-ai/Step-Code 的其他 Issue
-
area/build bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#190 · 2 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#185 · 1 条评论 ·
维护者通常 1 天内回复
-
area/tools bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#184 · 1 条评论 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#179 · 1 条评论 ·
维护者通常 1 天内回复
-
untriaged
难度 2/5 1-3 小时 新手友好度 75/100
stepfun-ai/Step-Code#151 · 1 条评论 ·
维护者通常 1 天内回复
查看 stepfun-ai/Step-Code 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
ccch1mneyyy/dsh-TUI#1631 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
MiniMax-AI/minimax-code#507 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
Transient OAuth login failure persists in getLoginStatus and masks active account in dashboard可能重新可做 关联的 PR 已关闭且未合并。 未关闭account-pool bug gui
难度 2/5 1-3 小时 新手友好度 67/100
lidge-jun/opencodex#7378 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复