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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user