Skip to content

Retry LLM planner requests on 429, 5xx and 529 - #1020

Closed
Mattbusel wants to merge 1 commit into
mne-tools:stagingfrom
tensorust-ai:deps/llm-retry-planner-429
Closed

Mattbusel wants to merge 1 commit into
mne-tools:stagingfrom
tensorust-ai:deps/llm-retry-planner-429

Conversation

@Mattbusel

Copy link
Copy Markdown

LlmToolPlanner::plan() gave up on the first error reply, so one 429 rate limit or 529 overload from the provider failed the whole plan.

This wraps the existing post and QEventLoop wait in llm::with_retry: 408, 429, 500, 502, 503, 504, 529 and network errors are retried up to 3 attempts with jittered backoff (0.5 s, then 1 s). Other errors (401, 400) still return on the first reply, through the same error handling as before.

Adds llm-retry v0.3.1 (header-only, MIT) through FetchContent, pinned to the tag. New test planner_retriesRateLimit answers 429 then 200 and checks the plan succeeds on the second request; it fails on the current code.

I (Matthew Busel) maintain llm-retry.

Disclosure: I maintain llm-retry.

@chdinh

chdinh commented Nov 21, 2026

Copy link
Copy Markdown
Member

Thanks, but we don't accept pull requests that add third-party dependencies maintained by the PR author, or unsolicited changes without a prior issue. Closing.

@chdinh chdinh closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants