search_files can substitute the wrong line when matched text contains :number:
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 75/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- devtools, testing-qa
Research direction
Look at the search_files function and its regex parsing of grep output. The issue is in the adapter that misinterprets :number: sequences within the matched text. Start by finding where the grep results are processed and identify the regex pattern. Test with the provided example file to see the substitution error. Verify the fix by ensuring the correct line number and text are preserved.
Written by the indexing model from the issue text.
Description
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
- Dominant language
- TypeScript
- Stars
- 54
- Forks
- 20
- Avg merge
- 4h 1m
- Merged PRs (30d)
- 12
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from stepfun-ai/Step-Code
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#190 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#185 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#184 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#179 · 1 comment ·
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
stepfun-ai/Step-Code#153 · 2 comments ·
All issues in stepfun-ai/Step-Code
Similar issues
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
-
Crush Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
catppuccin/catppuccin#3125 ·
-
Add a SECURITY.md Open
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ElementsProject/cln-application#167 · 1 comment · 1 reaction ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Quantco/pnpm-licenses#17 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100