Skip to content

fix(ai): refresh chat sidebar model status when provider keys change - #8581

Merged
utkarsh-bruno merged 3 commits into
usebruno:mainfrom
ravindra-bruno:fix/ai-sync-sidebar-status
Jul 14, 2026
Merged

utkarsh-bruno merged 3 commits into
usebruno:mainfrom
ravindra-bruno:fix/ai-sync-sidebar-status

Conversation

@ravindra-bruno

@ravindra-bruno ravindra-bruno commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

JIRA: BRU-3826

Description

Issue After setting/changing/removing the API key for an AI provider via Preferences, the Chat Sidebar did not reflect any change in its model list and send button until it was opened anew.

Cause: Status of the sidebar depends on the key store of the main process, which refreshes on [isOpen, aiEnabled, preferences.ai]. Neither key set nor key clear emits anything to Redux and does not broadcast an event, thus never changing what the sidebar listens to.

Resolution: The main process sends the main:ai-status-changed event after every key set/clear. The sidebar listens to it and uses the models in the payload.

Contribution Checklist:

  • I've used AI significantly to create this pull request
  • The pull request only addresses one issue or adds one feature.
  • The pull request does not introduce any breaking changes
  • I have added screenshots or gifs to help explain the change if applicable.
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

Before fix:
Screenshot 2026-07-13 at 1 08 20 PM

After Fix:
Screenshot 2026-07-13 at 1 05 29 PM

Screenshot 2026-07-13 at 1 05 54 PM

Summary by CodeRabbit

  • New Features

    • AI model availability now updates automatically when AI settings change, without requiring a refresh.
  • Bug Fixes

    • AI status changes are now reflected consistently after adding or removing an API key.
    • Reduced the minimum height of the AI assistant input area for a more compact interface.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 690070ff-7513-48c3-989c-23cca811db11

📥 Commits

Reviewing files that changed from the base of the PR and between 73131f0 and 21cd53c.

📒 Files selected for processing (1)
  • packages/bruno-app/src/components/AIAssist/StyledWrapper.js

Walkthrough

AI API key changes now broadcast updated AI status through Electron IPC. AiChatSidebar consumes pushed model availability updates, and the AI Assist popup input minimum height is reduced.

Changes

AI status synchronization and popup sizing

Layer / File(s) Summary
Broadcast AI status changes
packages/bruno-electron/src/ipc/ai/index.js
AI API key set and clear handlers build, broadcast, and return the latest status when the renderer window is available.
Consume pushed status
packages/bruno-app/src/components/AiChatSidebar/index.js
AiChatSidebar subscribes to main:ai-status-changed, updates availableModels, and removes the listener during cleanup.
Adjust popup input sizing
packages/bruno-app/src/components/AIAssist/StyledWrapper.js
The popup input minimum-height calculation changes its constant from 18px to 10px.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AiChatSidebar
  participant IpcRenderer
  participant MainProcess
  AiChatSidebar->>IpcRenderer: Register main:ai-status-changed listener
  MainProcess->>IpcRenderer: Broadcast updated AI status
  IpcRenderer->>AiChatSidebar: Deliver availableModels
  AiChatSidebar->>AiChatSidebar: Update model availability
Loading

Possibly related PRs

Suggested reviewers: helloanoop, lohit-bruno, bijin-bruno, sid-bruno, vijayh-bruno

Poem

Keys are set, statuses fly,
Models refresh through IPC sky.
The sidebar listens, neat and bright,
The popup shrinks to fit just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: refreshing chat sidebar AI model status when provider keys change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@utkarsh-bruno
utkarsh-bruno merged commit 8be2d75 into usebruno:main Jul 14, 2026
14 of 16 checks passed
sid-bruno added a commit to sid-bruno/bruno that referenced this pull request Jul 14, 2026
and annotations

fix(BulkEditor): preserve hidden metadata during bulk edit roundtrip

fix(ai): refresh chat sidebar model status when provider keys change (usebruno#8581)

* fix(ai): refresh chat sidebar model status when provider keys change

* Added the cropping related issue fix in AI Assist

fix(BulkEditor): enhance metadata preservation during bulk edit roundtrip
sid-bruno added a commit to sid-bruno/bruno that referenced this pull request Jul 14, 2026
and annotations

fix(BulkEditor): preserve hidden metadata during bulk edit roundtrip

fix(ai): refresh chat sidebar model status when provider keys change (usebruno#8581)

* fix(ai): refresh chat sidebar model status when provider keys change

* Added the cropping related issue fix in AI Assist

fix(BulkEditor): enhance metadata preservation during bulk edit roundtrip

fix(styled-wrapper): update placeholder styles to use theme variables

reset
sid-bruno added a commit to sid-bruno/bruno that referenced this pull request Jul 14, 2026
and annotations

fix(BulkEditor): preserve hidden metadata during bulk edit roundtrip

fix(ai): refresh chat sidebar model status when provider keys change (usebruno#8581)

* fix(ai): refresh chat sidebar model status when provider keys change

* Added the cropping related issue fix in AI Assist

fix(BulkEditor): enhance metadata preservation during bulk edit roundtrip

fix(styled-wrapper): update placeholder styles to use theme variables

reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants