acp: Fix behavior of read_text_file for ACP agents (#38401)

We were incorrectly handling the line number as well as stripping out
line breaks when returning portions of files.

It also makes sure following is updated even when we load a snapshot
from cache, which wasn't the case before.

We also are able to load the text via a range in the snapshot, rather
than allocating a string for the entire file and then another after
iterating over lines in the file.

Release Notes:

- acp: Fix incorrect behavior when ACP agents requested to read portions
of files.
32c868ff7dBen Brandt committed on 9/18/2025, 9:38:59 AM· committed by GitHubparented46e2c
1 file changedLine totals unavailable