-
Notifications
You must be signed in to change notification settings - Fork 0
fix(core): improve error handling in ConversationSession and metrics aggregation #337
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
fix(core): improve error handling in ConversationSession and metrics aggregation #337
Conversation
|
🏷️ This PR has been automatically assigned to milestone 1.0.1-alpha based on the version in |
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 improves error handling and metrics aggregation across the SmartHopper AI system. The changes centralize error management by migrating from string-based error messages to structured message collections, ensuring provider errors are properly surfaced to the WebChat UI.
Key changes:
- Replaced
AIReturn.ErrorMessageproperty with structuredMessagescollection for better error handling - Enhanced metrics aggregation in
ConversationSessionto accurately measure completion times for complex interactions - Added centralized error handling methods and improved error propagation throughout the system
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/SmartHopper.Infrastructure/AICall/Core/Returns/AIReturn.cs |
Core refactor removing ErrorMessage property and implementing structured message-based error handling |
src/SmartHopper.Infrastructure/AICall/Sessions/ConversationSession.cs |
Enhanced metrics tracking with completion time measurement and centralized error handling |
src/SmartHopper.Core/UI/Chat/WebChatDialog.cs |
Updated streaming failure detection to use structured messages instead of Success flag |
src/SmartHopper.Core.Grasshopper/AITools/*.cs |
Updated all AI tools to use structured message propagation instead of ErrorMessage |
| Provider model files | Simplified error handling by removing Success flag checks in API model retrieval |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Description
Error Handling:
Metrics and Performance:
Breaking Changes
No breaking changes introduced.
Testing Done
Checklist