Skip to content

fix(lightspeed): disable model selector in active chat sessions#3685

Open
its-mitesh-kumar wants to merge 1 commit into
redhat-developer:mainfrom
its-mitesh-kumar:fix/lightspeed-RHDHBUGS-3313-lock-model-in-active-chat
Open

fix(lightspeed): disable model selector in active chat sessions#3685
its-mitesh-kumar wants to merge 1 commit into
redhat-developer:mainfrom
its-mitesh-kumar:fix/lightspeed-RHDHBUGS-3313-lock-model-in-active-chat

Conversation

@its-mitesh-kumar

Copy link
Copy Markdown
Member

Description

Disable the model selector once an active chat session has started (messages exist in the conversation). When disabled, hovering over the selector shows a tooltip: "Each chat session supports only one model. To switch models, open a new chat." This prevents the confusing behavior where switching models mid-conversation would open a new chat thread.

Root cause

The MessageBarModelSelector component's onSelect handler unconditionally called onNewChat() when a model was chosen, creating a new conversation. The selector was only disabled during streaming (isSendButtonDisabled), but remained enabled for conversations that already had messages.

The fix disables the selector when messages.length > 0 (conversation has content) and wraps it in a Tooltip explaining the restriction. The tooltip message is fully localized in all 6 supported languages.

Fixed

  • RHDHBUGS-3313 — Lightspeed: Switching model in an active conversation incorrectly opens a new chat

Checklist

  • A changeset describing the change and affected packages. (more info)
  • Added or Updated documentation
  • Tests for new functionality and regression tests for bug fixes
  • Screenshots attached (for UI changes)

Made with Cursor

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 4, 2026

Copy link
Copy Markdown

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-lightspeed workspaces/lightspeed/plugins/lightspeed patch v2.9.1

@sonarqubecloud

sonarqubecloud Bot commented Jul 4, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.28%. Comparing base (d69d6d6) to head (ed2ec7d).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3685   +/-   ##
=======================================
  Coverage   54.28%   54.28%           
=======================================
  Files        2347     2347           
  Lines       89650    89656    +6     
  Branches    25020    25025    +5     
=======================================
+ Hits        48666    48670    +4     
- Misses      39456    39457    +1     
- Partials     1528     1529    +1     
Flag Coverage Δ *Carryforward flag
adoption-insights 83.70% <ø> (ø) Carriedforward from d69d6d6
ai-integrations 68.35% <ø> (ø) Carriedforward from d69d6d6
app-defaults 69.79% <ø> (ø) Carriedforward from d69d6d6
augment 46.39% <ø> (ø) Carriedforward from d69d6d6
boost 74.68% <ø> (ø) Carriedforward from d69d6d6
bulk-import 72.46% <ø> (ø) Carriedforward from d69d6d6
cost-management 14.10% <ø> (ø) Carriedforward from d69d6d6
dcm 61.81% <ø> (ø) Carriedforward from d69d6d6
extensions 61.53% <ø> (ø) Carriedforward from d69d6d6
global-floating-action-button 71.18% <ø> (ø) Carriedforward from d69d6d6
global-header 59.71% <ø> (ø) Carriedforward from d69d6d6
homepage 50.23% <ø> (ø) Carriedforward from d69d6d6
install-dynamic-plugins 56.77% <ø> (ø) Carriedforward from d69d6d6
konflux 91.49% <ø> (ø) Carriedforward from d69d6d6
lightspeed 68.81% <66.66%> (-0.01%) ⬇️
mcp-integrations 85.46% <ø> (ø) Carriedforward from d69d6d6
orchestrator 39.47% <ø> (ø) Carriedforward from d69d6d6
quickstart 65.63% <ø> (ø) Carriedforward from d69d6d6
sandbox 79.56% <ø> (ø) Carriedforward from d69d6d6
scorecard 82.67% <ø> (ø) Carriedforward from d69d6d6
theme 61.26% <ø> (ø) Carriedforward from d69d6d6
translations 7.25% <ø> (ø) Carriedforward from d69d6d6
x2a 78.68% <ø> (ø) Carriedforward from d69d6d6

*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 d69d6d6...ed2ec7d. 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.

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.

1 participant