Skip to content

Fix 429 retry header and parallelize portal fetches#27

Merged
dkships merged 1 commit into
mainfrom
fix/helpscout-retry-and-parallel-portals
Jul 10, 2026
Merged

Fix 429 retry header and parallelize portal fetches#27
dkships merged 1 commit into
mainfrom
fix/helpscout-retry-and-parallel-portals

Conversation

@dkships

@dkships dkships commented Jul 10, 2026

Copy link
Copy Markdown
Owner

What was wrong

  • HelpScoutClient.apiGet read the standard Retry-After header on 429s, but HelpScout sends X-RateLimit-Retry-After (rate-limiting docs). The header was never found, so every 429 fell back to blind exponential backoff.
  • A non-numeric header value would have produced setTimeout(NaN), an instant retry with no wait.
  • get_feature_requests fetched ProductLift portals serially, while synthesize_feedback / generate_product_plan already fetch them in parallel via Promise.allSettled.

What changed

  • Retry delay now prefers x-ratelimit-retry-after, falls back to retry-after, and only uses the header when it parses to a positive finite number; otherwise exponential backoff. MAX_429_RETRIES behavior is unchanged.
  • get_feature_requests uses the same Promise.allSettled pattern as the other tools. Per-portal warning isolation and message format are unchanged.

Tests

New src/helpscout.test.ts (fake timers + stubbed fetch): honours X-RateLimit-Retry-After, backs off when the header is absent, throws after MAX_429_RETRIES, and falls back to backoff (not an instant retry) on a non-numeric header. 70 tests passing overall.

🤖 Generated with Claude Code

Read X-RateLimit-Retry-After (the header HelpScout sends) with
Retry-After as fallback, and guard non-numeric values so a bad header
falls back to exponential backoff instead of setTimeout(NaN). Fetch
ProductLift portals in parallel in get_feature_requests, matching the
synthesize_feedback path. Add retry tests with fake timers.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dkships dkships marked this pull request as ready for review July 10, 2026 15:00
@dkships dkships merged commit 5f947c9 into main Jul 10, 2026
2 checks passed
@dkships dkships deleted the fix/helpscout-retry-and-parallel-portals branch July 10, 2026 15:00
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.

1 participant