fix(chunk): corrected chunk boundary calculations to prevent out-of-range violations

- Added bounds clamping to prologue and epilogue byte calculations to prevent out-of-range boundary violations.
- Extended chunk boundaries for indent-based languages when epilogue exceeds calculated range with trailing newline.
- Added comprehensive test coverage for Python chunk editing operations including body/head replacement and indentation preservation.
- Extracted working directory formatting logic into reusable utility function and applied tab sanitization to bash command previews.
This commit is contained in:
can1357
2026-04-08 11:49:00 +02:00
parent fee6b7858a
commit 26d7783370
8 changed files with 426 additions and 43 deletions
+6
View File
@@ -1368,6 +1368,12 @@ def run_model_sync(
time.sleep(min(max(recorder.auto_retry_delay_ms / 1000.0, 0.2), 2.0))
continue
if recorder.agent_ended:
grace = min(0.5, max(deadline - time.monotonic(), 0.0))
if grace > 0:
time.sleep(grace)
if recorder.auto_retry_active:
time.sleep(min(max(recorder.auto_retry_delay_ms / 1000.0, 0.2), 2.0))
continue
return
if recorder.is_effectively_complete(quiet_seconds=2.0):
return