Skip to content

fix(appkit): check isRetryable before retrying in interceptor#276

Open
MarioCadenas wants to merge 1 commit intomainfrom
fix/retryinterceptor-retries-all-errors
Open

fix(appkit): check isRetryable before retrying in interceptor#276
MarioCadenas wants to merge 1 commit intomainfrom
fix/retryinterceptor-retries-all-errors

Conversation

@MarioCadenas
Copy link
Copy Markdown
Collaborator

Summary

The RetryInterceptor retried all errors indiscriminately — including AuthenticationError (401), ValidationError (400), and Databricks SDK 4xx errors — wasting warehouse compute and delaying error responses. This PR adds an isRetryableError check that respects the AppKitError.isRetryable property and duck-types the Databricks SDK ApiError.isRetryable() method, with a status-code fallback (5xx/429 retry, 4xx don't).

Changes

  • Added isRetryableError() function to retry.ts that checks:
    1. AppKitError.isRetryable boolean property (covers all AppKit error subclasses)
    2. SDK ApiError.isRetryable() method via duck typing (no SDK import needed)
    3. Status-code heuristic fallback: 5xx and 429 → retryable, other 4xx → not retryable
    4. Unknown errors default to retryable (backward compatibility)
  • Inserted the check in the retry catch block, immediately after the abort-signal check
  • Added 9 new test cases covering all branches of isRetryableError

Test plan

  • All 19 retry tests pass (10 existing + 9 new)
  • All existing tests pass (5 pre-existing vector-search failures unrelated to this change)
  • Build succeeds
  • Biome lint/format passes
  • Manual verification: throw an AuthenticationError inside a plugin's execute() — it should propagate immediately without retries

The RetryInterceptor retried all errors including AuthenticationError
and ValidationError which have isRetryable=false. Now checks
error.isRetryable before scheduling a retry attempt. Also handles
Databricks SDK ApiError via duck-typed isRetryable() method and
status-code heuristic (4xx not retried, 5xx/429 retried).

Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
@MarioCadenas MarioCadenas force-pushed the fix/retryinterceptor-retries-all-errors branch from fd21bbb to a9fc61f Compare April 16, 2026 08:47
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