Skip to content

fix(runtime): preserve provider errors through retries - #1218

Merged
Astro-Han merged 1 commit into
apache:mainfrom
xuruiray:xurui/issue-1216-retry-error-classification
Jul 19, 2026
Merged

Astro-Han merged 1 commit into
apache:mainfrom
xuruiray:xurui/issue-1216-retry-error-classification

Conversation

@xuruiray

Copy link
Copy Markdown
Contributor

Summary

  • unwrap official AI SDK RetryError instances before provider error classification
  • preserve abort handling and fail closed for malformed or spoofed retry wrappers
  • cover rate limits, provider outages, context overflow, and ModelAdapter projection

Context

This is Part 1 of #1216 and is intentionally stacked on #1214 (xurui/issue-1084-provider-error-classification) so the retry-wrapper fix remains independently reviewable. It does not change retry policy or user-facing presentation.

Verification

  • TDD red phase: focused compiled tests failed in the two expected places before implementation
  • focused compiled tests: 23 passed, 0 failed
  • npm --workspace @maka/runtime run typecheck
  • npm --workspace @maka/runtime test: 2,147 passed, 7 skipped, 0 failed
  • npm run lint
  • git diff --check

Refs #1216

@xuruiray

Copy link
Copy Markdown
Contributor Author

Follow-up integration verification completed against the stacked runtime + desktop changes:

  • real Electron app, isolated user-data directory, loopback OpenAI-compatible provider
  • verified retry-preserved context_overflow, provider_billing, rate_limit, auth, and provider_unavailable reasons end to end
  • verified the non-overflow output-limit case remains unclassified rather than being mislabeled as context overflow
  • desktop Electron E2E: 26/26 passed
  • npm run build, npm run typecheck, npm run lint, and git diff --check passed
  • npm run test:dist: all workspace tests passed; desktop 2720/2720, 0 failed

The rendered UI screenshots are attached to the dependent presentation Draft #1219, where that visual behavior is implemented.

@xuruiray
xuruiray marked this pull request as ready for review July 18, 2026 17:54
@xuruiray
xuruiray force-pushed the xurui/issue-1216-retry-error-classification branch from 17318bb to 454f5b4 Compare July 19, 2026 04:10
Unwrap official AI SDK RetryError instances before classifying provider evidence, while keeping abort semantics and fail-closed behavior for malformed or spoofed wrappers.

Cover rate limits, provider outages, context overflow, aborts, empty wrappers, spoofed errors, and ModelAdapter projection.
@xuruiray
xuruiray force-pushed the xurui/issue-1216-retry-error-classification branch from 454f5b4 to d8a2a3a Compare July 19, 2026 07:58

@Astro-Han Astro-Han 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.

LGTM

@Astro-Han
Astro-Han merged commit 9579f0d into apache:main Jul 19, 2026
3 checks passed
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