Skip to content

fix(desktop): present provider failures from event reasons - #1219

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

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

Conversation

@xuruiray

Copy link
Copy Markdown
Contributor

Summary

  • present stable runtime ErrorEvent.reason values through one localized, typed allowlist
  • use the same safe presentation for conversation toasts, native notifications, and failed-turn labels
  • route provider billing failures to connection/account recovery while preserving the existing generic fallback for unknown reasons

Context

This is part 2 of #1216 and intentionally stays separate from the retry-classification change in #1218.

Dependencies: #1218, which is itself stacked on #1214. GitHub cannot use a branch from a contributor fork as the base of an upstream pull request, so this Draft currently targets main; the dependency commits will disappear from this diff as those PRs merge.

Verification

  • TDD red phase: focused presentation tests failed on the missing context-overflow/billing mappings and billing recovery route
  • focused desktop presentation tests: 45/45 passed
  • real Electron app with an isolated user-data directory and loopback OpenAI-compatible provider:
    • verified context_overflow, provider_billing, rate_limit, auth, and provider_unavailable end to end
    • verified a non-overflow output-limit response remains the generic fallback
    • verified the persisted report contains neither the injected placeholder key nor provider-secret marker
  • desktop Electron E2E: 26/26 passed
  • npm run build
  • npm run typecheck
  • npm run lint
  • git diff --check
  • npm run test:dist: all workspace tests passed; desktop 2720/2720, 0 failed

Visual evidence from the real Electron run will be attached to this Draft.

Refs #1216

@xuruiray

Copy link
Copy Markdown
Contributor Author

Real Electron visual verification

The screenshots below come from the isolated loopback-provider run used in the verification above. They show the actual Chinese toast copy rendered by the desktop application for the two newly distinguished failure classes.

Context overflow

Context overflow toast in Maka desktop

Provider billing

Provider billing toast in Maka desktop

@xuruiray
xuruiray marked this pull request as ready for review July 18, 2026 17:54
@xuruiray
xuruiray force-pushed the xurui/issue-1216-desktop-error-presentation branch 2 times, most recently from fca0174 to 4f7c4b3 Compare July 19, 2026 04:21

@likun666661 likun666661 left a comment

Copy link
Copy Markdown
Member

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 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

Copy link
Copy Markdown
Contributor

Need a rebase now before merging.

Use a shared localized allowlist for stable runtime error reasons across toasts, notifications, and failed-turn labels. Preserve the generic safe fallback for unknown reasons and route provider billing failures to connection recovery.
@xuruiray
xuruiray force-pushed the xurui/issue-1216-desktop-error-presentation branch from 4f7c4b3 to 1bde851 Compare July 19, 2026 12:16
@Astro-Han
Astro-Han merged commit 7d75147 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.

3 participants