Skip to content

feat: improve 429 error handling AUTO-158#129

Merged
Gikoskos merged 2 commits into
mainfrom
anderson/auto-158-stop-agentic-tasks-when-initial-calls-hit-429
Jun 19, 2026
Merged

feat: improve 429 error handling AUTO-158#129
Gikoskos merged 2 commits into
mainfrom
anderson/auto-158-stop-agentic-tasks-when-initial-calls-hit-429

Conversation

@andyMrtnzP

@andyMrtnzP andyMrtnzP commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes

    • Prevented automatic retries on HTTP 429 “concurrency limit reached” responses, reducing repeated session creation and additional rate-limit pressure.
    • Enhanced the concurrency-limit error guidance to recommend stopping retries and closing or waiting on existing sessions before upgrading.
  • Tests

    • Updated unit tests and error-message assertions to match the new 429 retry behavior and revised wording.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

HTTP 429 is added to the non-retryable upgrade status list in agent-client.ts, preventing retry logic from opening additional sessions against the concurrency limit. The user-facing error message in agent-format.ts for 429 responses is updated to explicitly say "Stop retrying" with recovery steps. Tests for both changes are updated accordingly. Additionally, package.json dependency overrides are extended to explicitly pin hono and undici versions.

Changes

429 Non-Retryable Classification and Error Messaging

Layer / File(s) Summary
Retry classification: add 429 to non-retryable set
src/lib/agent-client.ts, test/lib/agent-client.spec.ts
NON_RETRYABLE_UPGRADE_STATUSES is expanded to include 429 with an updated comment; the isRetryableUpgradeError tests are updated so 429 falls in the "does not retry" group and the retryable group covers only 5xx statuses.
Error message: "Stop retrying" guidance for 429
src/lib/agent-format.ts, test/tools/agent.spec.ts
The formatConnectError 429 branch now returns a message starting with "Stop retrying" and detailed session recovery steps; direct and proxy-injected 429 test assertions are updated to match the new wording.

Dependency Version Overrides

Layer / File(s) Summary
Add hono and undici version overrides
package.json
The overrides section is extended with explicit version constraints for hono (^4.12.26) and undici (^7.28.0).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 A 429 knocked on the door,
"No more sessions!" it did implore.
Stop retrying, close what's open wide,
The rabbit patched the retry guide.
And pinned the versions deep inside! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is completely empty; no content was provided by the author despite a clear template being available. Add a description following the repository template, including a summary of changes, related issues, test plan results, and checklist confirmations.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: improving HTTP 429 error handling, with a reference to the ticket AUTO-158.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch anderson/auto-158-stop-agentic-tasks-when-initial-calls-hit-429

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 112-113: The hono and undici dependencies in package.json are
using caret version ranges (^4.12.26 and ^7.28.0) which allow minor and patch
version upgrades. If the intent is true deterministic pinning to prevent version
drift on fresh installs, remove the caret (^) prefix from both version
specifiers, changing them to exact versions: 4.12.26 for hono and 7.28.0 for
undici.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 503332c5-cc63-435c-ad02-2b40cfb8f66c

📥 Commits

Reviewing files that changed from the base of the PR and between d2885bb and 18b593c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

Comment thread package.json
@Gikoskos Gikoskos merged commit f4b0122 into main Jun 19, 2026
5 checks passed
@Gikoskos Gikoskos deleted the anderson/auto-158-stop-agentic-tasks-when-initial-calls-hit-429 branch June 19, 2026 19:52
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