MGMT-21339: Add chatbot actions#3102
MGMT-21339: Add chatbot actions#3102openshift-merge-bot[bot] merged 1 commit intoopenshift-assisted:masterfrom
Conversation
|
@rawagner: This pull request references MGMT-21339 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughThis update refactors chatbot message handling to standardize message properties using a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatBotWindow
participant API
participant BotMessage
User->>ChatBotWindow: Send message
ChatBotWindow->>API: POST user message (with model/provider)
API-->>ChatBotWindow: Stream events (start, token, tool_call, end)
loop Streaming
ChatBotWindow->>ChatBotWindow: Process event (type guard)
alt Token event
ChatBotWindow->>ChatBotWindow: Append token to bot message content
else Tool response event
ChatBotWindow->>ChatBotWindow: Generate download action
ChatBotWindow->>BotMessage: Pass action(s)
end
end
ChatBotWindow->>BotMessage: Render message with actions
User->>BotMessage: Click download button
BotMessage->>file-saver: Trigger file download
Estimated code review effort🎯 4 (Complex) | ⏱️ ~35 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: in the assisted-installer-ui chatbot feedback implementation, the onfeedbacksubmit callback requires...Applied to files:
🪛 Biome (2.1.2)libs/chatbot/lib/components/ChatBot/helpers.ts[error] 63-83: This case is falling through to the next case. Add a (lint/suspicious/noFallthroughSwitchClause) 🔇 Additional comments (11)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@rawagner: This pull request references MGMT-21339 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
There was a problem hiding this comment.
Actionable comments posted: 5
🧹 Nitpick comments (2)
libs/chatbot/package.json (1)
41-41: Add TypeScript type definitions for file-saverSince this is a TypeScript project, consider adding the type definitions for the
file-saverlibrary to improve type safety and IDE support.Add to devDependencies:
"devDependencies": { "@tsconfig/recommended": "^1.0.2", + "@types/file-saver": "^2.0.5", "@types/node": "^18.14.6", "@types/react": "^18.0.0", "@types/react-dom": "^18.3.0" },Also applies to: 44-49
libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx (1)
154-155: Consider making model and provider configurableThe model and provider are hardcoded. Consider making these configurable through props or environment variables for flexibility across different deployments.
body: JSON.stringify({ query: `${message}`, conversation_id: conversationId, - model: 'gemini/gemini-2.5-flash', - provider: 'gemini', + model: process.env.CHATBOT_MODEL || 'gemini/gemini-2.5-flash', + provider: process.env.CHATBOT_PROVIDER || 'gemini', }),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (5)
libs/chatbot/lib/components/ChatBot/BotMessage.tsx(4 hunks)libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx(8 hunks)libs/chatbot/lib/components/ChatBot/helpers.ts(2 hunks)libs/chatbot/lib/components/ChatBot/types.ts(1 hunks)libs/chatbot/package.json(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
📚 Learning: in the assisted-installer-ui chatbot feedback implementation, the onfeedbacksubmit callback requires...
Learnt from: celdrake
PR: openshift-assisted/assisted-installer-ui#3051
File: libs/chatbot/lib/components/ChatBot/ChatBotWindow.tsx:196-222
Timestamp: 2025-07-18T12:35:50.945Z
Learning: In the assisted-installer-ui chatbot feedback implementation, the onFeedbackSubmit callback requires access to the messages array to retrieve both the bot response content and the associated user question for the API call, making it necessary to include messages in the useCallback dependency array rather than passing message content as props to avoid duplicating potentially long message data.
Applied to files:
libs/chatbot/lib/components/ChatBot/helpers.tslibs/chatbot/lib/components/ChatBot/ChatBotWindow.tsxlibs/chatbot/lib/components/ChatBot/BotMessage.tsx
🪛 Biome (2.1.2)
libs/chatbot/lib/components/ChatBot/helpers.ts
[error] 63-83: This case is falling through to the next case.
Add a break or return statement to the end of this case to prevent fallthrough.
(lint/suspicious/noFallthroughSwitchClause)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: circular-deps
- GitHub Check: unit-tests
- GitHub Check: tests
- GitHub Check: translation-files
- GitHub Check: format
- GitHub Check: lint
c9355d5 to
403a67f
Compare
|
@rawagner: This pull request references MGMT-21339 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.20.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
403a67f to
226c63d
Compare
226c63d to
8b95c39
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ammont82, rawagner The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
7aa4436
into
openshift-assisted:master

Adds buttons for download actions
Summary by CodeRabbit
New Features
Improvements
Chores