Repository navigation
fix(engine): subagents survive shared-quota 429s; a dead child reports itself resumable (#1849) - #1851
Merged
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…orts itself resumable (#1849) Two compounding bugs killed subagents on Baseten 429s (retry-after: 1): - retry.ts: the header was the whole wait and RETRY_MAX_RETRIES=5 applied, so a rate limit got 5 x 1s retries (~6s) and the turn died. Rate-limited errors (429 / rate-limit message, excluding the free/Go usage-limit upsells) now back off exponentially with jitter, capped at 60s/attempt, with the provider hint as a floor, for a 10-minute budget. Other errors keep the 5-attempt cap. The header parse is factored into hint(). - task.ts: runTask returned the last text part (or "") without checking the child message for an error, so the parent saw an empty completed result and started a fresh subagent. An errored child (other than a user abort) now fails the task with the error, the preserved session id, an explicit task_id resume instruction, and the child's last output.
aarontrowbridge
force-pushed
the
fix/1849-subagent-429
branch
from
October 23, 2026 13:24
3d1888e to
2d36dcc
Compare
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.
Fixes #1849. Related: #596.
Retry (
session/retry.ts, newly in the overlay)retry-afteris a floor, not the whole wait. They keep retrying for a 10-minute budget instead of 5 attempts.delay()behavior. The header parse moved intohint(), unchanged.429, retry-after: 1got 5 × 1s retries (~6s) and the turn died. 10 sessions died this way between 10-20 and 10-23.Task (
tool/task.ts)runTasknow checks the child's final message for an error. An errored child (anything except a user abort) fails the task with the error name and message, the preserved session id, an explicittask_id="…"resume instruction, and the child's last output. Foreground and background (task_error) paths both carry it.state="completed"with an empty<task_result>and started a fresh subagent, so the child's work was lost.Tests
isRateLimitclassification; backoff with the hint as a floor ([2s,4s,8s,16s,32s,60s,60s,60s]underretry-after: 1); a long hint wins; the policy keeps retrying past the 5-attempt cap and stops once the budget is spent (deterministicSchedule.toSteptimestamps); an errored child fails with itstask_idand partial output. All fail on base, pass here.test/session+test/tool+test/background: 971 pass. The 6 failures are the gate's known-environmental families (Instruction.system, excludedllm-native-recorded,tool.writepermissions).Deploy
Engine change. It rides the same engine rebuild/swap as #1850.