Conversation
The resume-delay budget (30/60/120s) resets whenever the dying agent printed ANY assistant line. A crash-looping agent (e.g. expired OAuth, one line then exit) makes identical progress every attempt, so the retry loop never terminates. Replace the made_progress boolean with an assistant-line count and reset the budget only when an attempt beats the best previous count. A crash loop drains the retries and returns the error; a genuinely progressing agent still earns resets. Fixes dstackai#4163
Contributor
|
@breken-ai we don't accept PRs if the implementation is not discussed first and the author that submits the PR is not actively using dstack. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
The resume-delay budget (30/60/120s) resets whenever the dying agent printed ANY assistant line. A crash-looping agent (your expired-OAuth case: one assistant line then exit) makes identical "progress" every attempt, so the
made_progressboolean can't distinguish "got further" from "got to the same place again" - the retry loop never terminates.Fix
Replace the boolean with an assistant-line count and reset the budget only when an attempt exceeds the best previous attempt. A dying agent drains the 30/60/120s retries and returns the error; a genuinely progressing agent still earns resets.
Verification
End-to-end regression test with a fake claude subprocess that prints one assistant line then exits 1: unbounded on current HEAD (9 attempts and counting), exactly 4 attempts with the fix. Full presets agent suite: 64 passed, 1 pre-existing Windows-only env failure (fails on main too, unrelated).
Fixes #4163