Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for capturing and processing frontend tool execution results in the AI chat system. The implementation allows the frontend to send tool outputs back to the backend, which are then properly integrated into the chat history for continued conversation flow.
Changes:
- Added
ToolResulttype and extraction logic to capture frontend tool execution outputs - Refactored tool result handling to use actual frontend results instead of placeholder messages
- Updated message parsing to support tool-result-only submissions
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/shared/src/lib/ai/chat/index.ts | Adds ToolResult type and AIChatMessage union type for structured tool output |
| packages/server/api/test/unit/mcp/tool-utils.test.ts | Comprehensive test coverage for new tool result extraction and mapping utilities |
| packages/server/api/src/app/ai/mcp/tool-utils.ts | Implements tool result extraction from messages and logic to add missing UI tool results to chat history |
| packages/server/api/src/app/ai/chat/user-message-handler.ts | Integrates frontend tool results into chat history processing flow |
| packages/server/api/src/app/ai/chat/message-parser.ts | Updates message parser to handle tool-result-only submissions with dedicated constant |
| packages/server/api/src/app/ai/chat/chat-request-router.ts | Adds routing support for tool-result-only messages and passes frontend results through request pipeline |
| packages/server/api/src/app/ai/chat/ai-mcp-chat.controller.ts | Extracts tool results from incoming messages and handles tool-result-only submissions |
| packages/react-ui/src/app/features/ai/lib/assistant-ui-chat-hook.ts | Updates frontend to use addToolOutput with structured state information instead of addToolResult |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
217
to
219
| input: isToolResultOnly | ||
| ? UI_TOOL_RESULT_SUBMISSION_MESSAGE | ||
| : messageContent, |
Contributor
There was a problem hiding this comment.
Do we need this change? As you also change the 'parseUserMessage', I think the messageContent has the right value
MarceloRGonc
reviewed
Feb 2, 2026
|
❌ The last analysis has failed. |
MarceloRGonc
approved these changes
Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes OPS-3483