Show line range in agent host file-read tool display (#312062)
* Show line range in agent host file-read tool display
When the Copilot CLI's `view` tool is called with a `view_range`, surface
the line range in the invocation and past-tense messages so users see e.g.
"Reading file.ts, lines 10 to 20" instead of just "Reading file.ts".
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Match Copilot Chat extension's view_range validation
Drop the EOF-sentinel handling and require a strictly valid two-element
range (`length === 2`, integers, `start >= 0`, `end >= start`); fall back
to the path-only display otherwise. Mirrors `formatViewToolInvocation`
in the Copilot Chat extension and addresses review feedback on the
`-1` end-of-file sentinel and the stale doc comment.
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Handle view_range `-1` end-of-file sentinel
The Copilot CLI uses `-1` as the documented "to end of file" sentinel
for the second element of `view_range`. The Copilot Chat extension
doesn't handle this and either drops the range or renders "-1"
literally; do better here by rendering "from line {n} to the end".
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* Tweak EOF view_range wording
(Written by Copilot)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> R
Rob Lourens committed
f9eafcd6219d8ade3c5983b169d6bbe96b242e26
Parent: ea9b0f1
Committed by GitHub <noreply@github.com>
on 4/23/2026, 3:42:49 AM