Skip to content

fix(client): make HTTP read retries opt-in - #442

Open
kartojal wants to merge 1 commit into
mainfrom
feat/auth-refresh-callback
Open

kartojal wants to merge 1 commit into
mainfrom
feat/auth-refresh-callback

Conversation

@kartojal

@kartojal kartojal commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

HTTP reads retried by default, which conflicts with callers and query libraries that own retry policy.

Fix

  • Make HTTP read retries opt-in: retries defaults to 0. Passing 1 to 5 enables retries for transport failures and short rate-limit waits. Mutations are never retried.
  • Remove the unused mutation retry: false option and retryMutations configuration; update public TSDoc, README, AGENTS.md and focused retry tests to match.
  • Preserve the existing per-attempt timeout, cancellation and shared read retry budget behavior.

Stack scope

The callback-owned AuthenticatedServiceClient transport is isolated in #481. Bearer/L2 credential types, strict input schemas and the concrete session lifecycle are introduced in #437.

Stack: #442 → #481 → #437 → #463 → #438 → #441.

🤖 Generated with Claude Code


Note

Medium Risk
This is a breaking default change for read retries that can surface more failures unless callers opt back in; transport code edits need careful validation even though mutations stay single-shot.

Overview
Summary
HTTP reads now start with zero transport retries unless callers pass retries > 0; parseRequestOptions and Ky initialization align with that default so mutations remain single-shot while opt-in reads share the existing retry budget.

Documentation & examples
README, AGENTS.md, decorator/action TSDoc, and the changeset call out the new default and show how to re-enable retries; RFQ tests expect the lighter default.

Tests
ServiceClient suites were reworked to assert single-attempt behavior for mutations and the opt-in retry path, dropping obsolete rate-limit/backoff scenarios.

Reviewed by Cursor Bugbot for commit c3f879b. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread packages/client/src/credentials.ts Resolved
@kartojal
kartojal force-pushed the feat/auth-refresh-callback branch 2 times, most recently from f2bfde8 to 775acb8 Compare October 26, 2026 15:42
@kartojal kartojal changed the title refactor(client): configure service authentication through callbacks fix(client): make HTTP read retries opt-in Oct 26, 2026
@kartojal
kartojal removed this pull request from stack #464 October 26, 2026 15:46
@kartojal
kartojal added this pull request to stack #482 October 26, 2026 15:47
@kartojal
kartojal force-pushed the feat/auth-refresh-callback branch 2 times, most recently from 6cd8f0c to a92e6e8 Compare November 3, 2026 17:52

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a92e6e8. Configure here.

readonly #onRateLimitUpdate?: RateLimitUpdateListener;

constructor(config: ServiceClientConfig) {
const {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Workflow GETs lose transport retries

Medium Severity

Setting the shared ky instance retry to 0 also disables the previous GET transport recovery used by getWorkflow. Those command paths (API-key derivation, perps credential checks, and balance-allowance updates) no longer retry network failures and cannot opt in with retries. The new docs still say workflow retry policy is unchanged.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a92e6e8. Configure here.

@kartojal
kartojal force-pushed the feat/auth-refresh-callback branch from a92e6e8 to c3f879b Compare November 6, 2026 09:36
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