FanouZeng-TT 55f5d6b629
fix(sandbox): clamp negative read_file range bounds (#5655)
* fix(sandbox): clamp a negative start_line in provider read_file

LocalSandbox.read_file clamps the start line with max(start_line or 1, 1),
but e2b, OpenSandbox and BoxLite used start_line or 1, so a negative value
reached Python's negative-index slicing and read from the end of the file
instead of the first line. Clamp all three the same way, and pin the
boundary cases in their existing range tests: a past-EOF start still returns
an empty string, a negative start reads from line 1.

Surfaced by the review of #5616 (e2b has the same gap, consistency nit).

* fix(sandbox): clamp negative end_line across providers

Complete the range-bound consistency fix for e2b, OpenSandbox and BoxLite:
clamp a negative end_line to zero like LocalSandbox instead of letting
Python's negative-index slicing silently drop trailing lines. Add the
symmetric boundary assertion to each provider's existing range test.
2026-09-25 10:22:38 +08:00
..