You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
grep tool silently ignores n, so models that drop the dash from -n get no line numbers #5038
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.
Activity