-
Notifications
You must be signed in to change notification settings - Fork 3.6k
feat(provider-settings): support viewing detailed error messages #12423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds clickable error detail functionality to health status indicators in provider settings and model detection. Users can now click on error icons to view detailed error information in a modal dialog, addressing the issue where error messages were truncated in tooltips.
Changes:
- Changed error type from string to SerializedError throughout health check system for richer error information
- Added clickable error icons that open ErrorDetailModal with full error details
- Exported ErrorDetailModal from ErrorBlock for reuse across the application
- Fixed flex alignment properties and improved tooltip layouts
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/renderer/src/types/healthCheck.ts | Updated ApiKeyConnectivity error type from string to SerializedError |
| src/renderer/src/services/HealthCheckService.ts | Added error serialization logic to convert rejected promises to SerializedError objects |
| src/renderer/src/pages/settings/ProviderSettings/ProviderSetting.tsx | Made error icon clickable, added ErrorDetailModal, and serialized errors on API check failure |
| src/renderer/src/pages/settings/ProviderSettings/ModelList/ModelListItem.tsx | Added onErrorClick callback and ErrorDetailModal integration for model list items |
| src/renderer/src/pages/home/Messages/Blocks/ErrorBlock.tsx | Exported ErrorDetailModal component for reuse |
| src/renderer/src/components/Popups/ApiKeyListPopup/hook.ts | Updated error handling to use SerializedError type |
| src/renderer/src/components/HealthStatusIndicator/useHealthStatus.tsx | Updated to access error.message from SerializedError and fixed flex alignment |
| src/renderer/src/components/HealthStatusIndicator/types.ts | Added HealthStatusIndicatorProps interface with onErrorClick callback |
| src/renderer/src/components/HealthStatusIndicator/indicator.tsx | Made error icon clickable when onErrorClick is provided and fixed flex alignment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/renderer/src/components/HealthStatusIndicator/useHealthStatus.tsx
Outdated
Show resolved
Hide resolved
src/renderer/src/pages/settings/ProviderSettings/ModelList/ModelListItem.tsx
Outdated
Show resolved
Hide resolved
src/renderer/src/components/HealthStatusIndicator/indicator.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
src/renderer/src/components/HealthStatusIndicator/indicator.tsx:53
- The "partial" status (when some API keys pass and some fail) should also support error click functionality. Currently, onErrorClick is only handled for the "error" case, but in partial failures, users would also benefit from being able to click the warning icon to see which keys failed. Consider making the ExclamationCircleFilled icon clickable when onErrorClick is provided and there are failed results.
case 'partial':
icon = <ExclamationCircleFilled />
break
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/renderer/src/pages/settings/ProviderSettings/ProviderSetting.tsx
Outdated
Show resolved
Hide resolved
src/renderer/src/components/HealthStatusIndicator/indicator.tsx
Outdated
Show resolved
Hide resolved
src/renderer/src/pages/settings/ProviderSettings/ModelList/ModelListItem.tsx
Outdated
Show resolved
Hide resolved
9ca4655 to
8eabf4a
Compare
6192c16 to
ae407d9
Compare
ae407d9 to
45ecdac
Compare
- Add onErrorClick callback to HealthStatusIndicator component - Make error icon clickable to show detailed error modal - Export ErrorDetailModal for reuse across components - Use SerializedError type for better error information display - Fix tooltip i18n keys and flex layout for consistent spacing
…xist - Only pass onErrorClick callback when there are failed results - Conditionally render ErrorDetailModal only when needed - Improve performance by avoiding unnecessary state for success cases
- Extract duplicated error serialization logic into serializeHealthCheckError() utility function in error.ts - Update HealthCheckService.ts, hook.ts, and ProviderSetting.tsx to use the new utility function - Fix invalid CSS values: align-items: left -> center, align: left -> flex-start - Use HealthStatus.FAILED constant instead of hardcoded 'failed' string
Change the tooltip fallback translation key from the provider API check to the models check. This ensures the displayed message matches the new i18n key and avoids showing an incorrect/provider-specific string when the API key connectivity error message is absent.
- Memoize ErrorDetailModal child components (BuiltinError, AiSdkErrorBase, TruncatedCodeViewer, AiSdkError) - Add useCallback for handleErrorClick in HealthStatusIndicator - Add useCallback for copyErrorDetails in ErrorDetailModal - Optimize ModelListItem button inline functions with useCallback
- HealthStatusIndicatorProps was only used in indicator.tsx, no need to export - Keep HealthResult in types.ts as it's used by useHealthStatus hook
- useHealthStatus depends on HealthResult from ./types - Only HealthStatusIndicatorProps belongs to indicator.tsx
- wrap healthResults in useMemo to avoid unnecessary re-renders - remove redundant ErrorDetailModal export from ErrorBlock
- Use parseDataUrl from @shared/utils instead of manual base64 detection - Replace duplicate ErrorDetailModal in ErrorBlock with the shared component - Optimize onErrorClick with useMemo for better performance
45ecdac to
c9a9bc1
Compare
What this PR does
Before this PR:
After this PR:
Fixes #12367
Why we need it and why it was done in this way
The following tradeoffs were made:
The following alternatives were considered:
Links to places where the discussion took place:
Breaking changes
Special notes for your reviewer
Checklist
Release note