Skip to content

fix(lightspeed): disable model selector during active chat sessions - #3690

Merged
ciiay merged 10 commits into
redhat-developer:mainfrom
its-mitesh-kumar:fix/lightspeed-RHDHBUGS-3313-disable-model-selector-active-session
Jul 28, 2026
Merged

fix(lightspeed): disable model selector during active chat sessions#3690
ciiay merged 10 commits into
redhat-developer:mainfrom
its-mitesh-kumar:fix/lightspeed-RHDHBUGS-3313-disable-model-selector-active-session

Conversation

@its-mitesh-kumar

@its-mitesh-kumar its-mitesh-kumar commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Fixes RHDHBUGS-3313

Bug: Switching the model in an active conversation incorrectly opens a new chat instead of staying in the current session.

Root cause: The model selector's onSelect handler in LightSpeedChat.tsx unconditionally called onNewChat(), creating a new conversation every time the model was changed — even mid-conversation.

Fix:

  • Disable the model selector once a chat session has messages (messages.length > 0)
  • Show a localized tooltip explaining why: "Each chat session supports only one model. To switch models, open a new chat."
  • Remove the spurious onNewChat() call from the model selector's onSelect handler
  • Move the attach file (+) button to the left-most position in the message bar for better UX
  • Remove redundant isModelSelectorDisabled prop from the header model selector (it is already hidden via hideModelSelector)

UI after changes

S_.2026-07-26.at.12.00.06.PM.mov

Test plan

  • yarn tsc:full passes with no errors
  • yarn build passes
  • Manual verification: open Intelligent Assistant, send a message, confirm model selector is disabled with tooltip
  • Manual verification: start a new chat, confirm model selector is enabled again
  • Manual verification: confirm attach (+) button appears at the left-most position in the message bar

Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-3313
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@rhdh-gh-app

rhdh-gh-app Bot commented Jul 6, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-intelligent-assistant workspaces/intelligent-assistant/plugins/intelligent-assistant patch v3.1.0

@codecov

codecov Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.48%. Comparing base (6680291) to head (2c1b7ce).
⚠️ Report is 31 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3690      +/-   ##
==========================================
- Coverage   57.34%   55.48%   -1.87%     
==========================================
  Files        2382     2468      +86     
  Lines       95599    95365     -234     
  Branches    26722    26560     -162     
==========================================
- Hits        54825    52917    -1908     
- Misses      40537    42175    +1638     
- Partials      237      273      +36     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.68% <ø> (-0.87%) ⬇️ Carriedforward from d634de2
ai-integrations 67.44% <ø> (-1.63%) ⬇️ Carriedforward from d634de2
app-defaults 69.79% <ø> (ø) Carriedforward from d634de2
augment 46.39% <ø> (-0.29%) ⬇️ Carriedforward from d634de2
boost 74.85% <ø> (-1.08%) ⬇️ Carriedforward from d634de2
bulk-import 72.46% <ø> (-0.10%) ⬇️ Carriedforward from d634de2
cost-management 14.10% <ø> (+0.55%) ⬆️ Carriedforward from d634de2
dcm 61.81% <ø> (+1.08%) ⬆️ Carriedforward from d634de2
extensions 61.53% <ø> (+5.24%) ⬆️ Carriedforward from d634de2
global-floating-action-button 71.18% <ø> (ø) Carriedforward from d634de2
global-header 59.71% <ø> (-2.47%) ⬇️ Carriedforward from d634de2
homepage 50.23% <ø> (+2.43%) ⬆️ Carriedforward from d634de2
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from d634de2
intelligent-assistant 74.24% <100.00%> (+0.18%) ⬆️
konflux 91.49% <ø> (-0.49%) ⬇️ Carriedforward from d634de2
lightspeed 68.96% <ø> (-0.06%) ⬇️ Carriedforward from d634de2
mcp-integrations 85.46% <ø> (+2.06%) ⬆️ Carriedforward from d634de2
orchestrator 39.47% <ø> (-23.20%) ⬇️ Carriedforward from d634de2
quickstart 65.63% <ø> (+0.58%) ⬆️ Carriedforward from d634de2
sandbox 79.56% <ø> (ø) Carriedforward from d634de2
scorecard 82.67% <ø> (+0.03%) ⬆️ Carriedforward from d634de2
theme 61.26% <ø> (-22.59%) ⬇️ Carriedforward from d634de2
translations 7.25% <ø> (+2.13%) ⬆️ Carriedforward from d634de2
x2a 78.68% <ø> (-0.63%) ⬇️ Carriedforward from d634de2

*This pull request uses carry forward flags. Click here to find out more.


Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6680291...2c1b7ce. Read the comment docs.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

Cc: @HusneShabbir if you get time please check if atleast functionality is working properly. As it is first pr by bug-fix skill.

@HusneShabbir HusneShabbir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@its-mitesh-kumar I agree that this is an edge-case scenario, but I think it's worth addressing as well.

Image

When the model dropdown is open and a message is sent, it's still possible to change the model mid-conversation. Please refer to the recording below.

It would be great if we could handle this case too and prevent the model from being changed while a conversation is in progress.

cc: @karthikjeeyar / @rohitkrai03

Screen.Recording.2026-07-06.at.8.37.29.PM.mov

@github-actions

Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity from the author. It will be closed if no further activity occurs. If the PR was closed and you want it re-opened, let us know and we'll re-open the PR so that you can continue the contribution!

@github-actions github-actions Bot added stale and removed stale labels Jul 20, 2026
…3313-disable-model-selector-active-session

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

# Conflicts:
#	workspaces/intelligent-assistant/.changeset/gentle-models-lock.md
@its-mitesh-kumar
its-mitesh-kumar requested review from a team as code owners July 26, 2026 05:23
@github-actions

Copy link
Copy Markdown
Contributor

This pull request adds a new top-level directory under workspaces/. Please follow Submitting a Pull Request for a New Workspace in CONTRIBUTING.md.

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

@its-mitesh-kumar I agree that this is an edge-case scenario, but I think it's worth addressing as well.

Image When the model dropdown is open and a message is sent, it's still possible to change the model mid-conversation. Please refer to the recording below.

It would be great if we could handle this case too and prevent the model from being changed while a conversation is in progress.

cc: @karthikjeeyar / @rohitkrai03

Screen.Recording.2026-07-06.at.8.37.29.PM.mov

@HusneShabbir Now you can see as soon as user press Enter or Send button, Dropdown is closed.

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@tobiastal

tobiastal commented Jul 27, 2026

Copy link
Copy Markdown

LGTM
cc @its-mitesh-kumar

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

@HusneShabbir HusneShabbir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still able to reproduce the issue, PTAL

Screen.Recording.2026-07-27.at.5.19.38.PM.mov

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@its-mitesh-kumar

Copy link
Copy Markdown
Member Author

/retest

@its-mitesh-kumar

Copy link
Copy Markdown
Member Author
  • prop from the header model selector (it is already hidden via hideModelSelector)

Fixed now, also added e2e for the same.

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
@sonarqubecloud

Copy link
Copy Markdown

@its-mitesh-kumar
its-mitesh-kumar requested a review from ciiay July 28, 2026 02:58

@HusneShabbir HusneShabbir left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm, Thanks for fixing this

@ciiay
ciiay merged commit 3d96cd5 into redhat-developer:main Jul 28, 2026
36 checks passed
JslYoon pushed a commit to JslYoon/rhdh-plugins that referenced this pull request Jul 28, 2026
…edhat-developer#3690)

* fix(lightspeed): disable model selector during active chat sessions

Fixes: https://redhat.atlassian.net/browse/RHDHBUGS-3313
Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>

* docs: add before-fix recording

* docs: add after-fix recording

* removing gifs

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

* moving the attach file icon leftmost

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

* updating test

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

* updating the tests

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

* closing modal selector on enter or send

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

* addressing the comment

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>

---------

Signed-off-by: its-mitesh-kumar <itsmiteshkumar98@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants