Skip to content

Conversation

@marc-romu
Copy link
Member

@marc-romu marc-romu commented Oct 13, 2025

Description

Error Handling:

  • Centralized error handling in AIReturn and tool calls for better consistency
  • Fixed provider errors (e.g., HTTP 400, token limit exceeded) not surfacing to WebChat UI by ensuring ConversationSession surfaces AIInteractionError from error AIReturn bodies to observers before calling OnError

Metrics and Performance:

  • Improved metrics aggregation in ConversationSession to accurately calculate completion time per interaction for cases with multiple tool calls and interactions

Breaking Changes

No breaking changes introduced.

Testing Done

  • Tested error handling in WebChat UI to ensure provider errors are properly surfaced
  • Confirmed metrics aggregation accuracy with multiple tool calls and interactions

Checklist

  • This PR is focused on a single feature or bug fix
  • Version in Solution.props was updated, if necessary, and follows semantic versioning
  • CHANGELOG.md has been updated
  • PR title follows Conventional Commits format
  • PR description follows Pull Request Description Template

Copilot AI review requested due to automatic review settings October 13, 2025 05:08
@github-actions github-actions bot added this to the 1.0.1-alpha milestone Oct 13, 2025
@github-actions
Copy link
Contributor

🏷️ This PR has been automatically assigned to milestone 1.0.1-alpha based on the version in Solution.props.

@marc-romu marc-romu added component: AI ListGenerate Issues related to the AI List Generate component scope: Conversation Session Issues related to the Conversation Session logic labels Oct 13, 2025
@marc-romu marc-romu self-assigned this Oct 13, 2025
Copy link
Contributor

Copilot AI left a 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.ErrorMessage property with structured Messages collection for better error handling
  • Enhanced metrics aggregation in ConversationSession to 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.

@marc-romu marc-romu linked an issue Oct 13, 2025 that may be closed by this pull request
@marc-romu marc-romu merged commit f13edfb into dev Oct 13, 2025
10 checks passed
@github-actions github-actions bot deleted the bugfix/1.0.1-large-list-generation-empty-response branch October 13, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: AI ListGenerate Issues related to the AI List Generate component scope: Conversation Session Issues related to the Conversation Session logic

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Large list generation returns empty provider response

2 participants