Describe the bug
The built-in grep tool shows line numbers only when it gets "-n": true. An argument named n, without the dash, is accepted without an error and ignored, so the matches come back without line numbers.
Models do drop the dash. In 664 headless benchmark runs on 1.0.90, claude-haiku-4.5 passed "n": true in 920 of its 1,949 grep calls and "-n": true in 22. claude-sonnet-5 passed -n in 508 of 571 calls and claude-opus-5.5 in all 53. Without line numbers haiku counted lines in files it opened with view, which also returns no line numbers, and was off by a few: 78 of its 79 wrong answers to "which line…" questions were a wrong line number.
Affected version
1.0.91 (also 1.0.90)
Steps to reproduce the behavior
In a git repository with notes.txt containing alpha, beta, needle here, gamma on four lines:
copilot -p 'Call the grep tool twice and nothing else. First call: {"pattern": "needle", "paths": "notes.txt", "output_mode": "content", "n": true}. Second call: {"pattern": "needle", "paths": "notes.txt", "output_mode": "content", "-n": true}. Then reply with the two raw tool results.' --model claude-haiku-4.5 --allow-all-tools --available-tools grep --output-format json -s
With "n": true the tool returns notes.txt:needle here. With "-n": true it returns notes.txt:3:needle here.
Expected behavior
Either accept n as an alias for -n, or reject unknown arguments with an error the model can see and correct.
Additional context
The counts come from the session logs of a public benchmark: https://github.com/nefayran/code-graph-vs-grep
Describe the bug
The built-in grep tool shows line numbers only when it gets
"-n": true. An argument namedn, without the dash, is accepted without an error and ignored, so the matches come back without line numbers.Models do drop the dash. In 664 headless benchmark runs on 1.0.90, claude-haiku-4.5 passed
"n": truein 920 of its 1,949 grep calls and"-n": truein 22. claude-sonnet-5 passed-nin 508 of 571 calls and claude-opus-5.5 in all 53. Without line numbers haiku counted lines in files it opened withview, which also returns no line numbers, and was off by a few: 78 of its 79 wrong answers to "which line…" questions were a wrong line number.Affected version
1.0.91 (also 1.0.90)
Steps to reproduce the behavior
In a git repository with
notes.txtcontainingalpha,beta,needle here,gammaon four lines:With
"n": truethe tool returnsnotes.txt:needle here. With"-n": trueit returnsnotes.txt:3:needle here.Expected behavior
Either accept
nas an alias for-n, or reject unknown arguments with an error the model can see and correct.Additional context
The counts come from the session logs of a public benchmark: https://github.com/nefayran/code-graph-vs-grep