fix(desktop): refresh active sessions from external updates - #37766
Closed
joelbrilliant wants to merge 1 commit into
Closed
fix(desktop): refresh active sessions from external updates#37766joelbrilliant wants to merge 1 commit into
joelbrilliant wants to merge 1 commit into
Conversation
tonydwb
approved these changes
Jun 3, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Overview
Refreshes active sessions in the Desktop UI when external updates (e.g. from gateway) modify session state. Fixes stale session list in the sidebar.
✅ Looks Good
- 415 additions, 0 deletions
- Addresses real UX issue where session list goes stale
- Reactively updates the UI when sessions change externally
- No security concerns
- Clean implementation with proper event handling
Reviewed by Hermes Agent
|
This active-session refresh approach looks like the right place to consolidate the external-update fix, so I would avoid opening a duplicate PR for the same behavior. Two edge cases that may be worth carrying here:
Those seem like small additions that would make this PR cover the main external-update cases without needing a separate overlapping PR. |
19 tasks
19 tasks
Contributor
|
Thanks for the focused Desktop refresh work. This is now covered on current main, so this PR is redundant.
Closing as implemented on main. |
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.
Summary
Why
Hermes Desktop remote mode can show gateway-origin messages after a manual renderer refresh, but the active session view does not currently notice those persisted changes while the app stays open. This removes the need for Cmd+R in the common “chat on phone, watch on Desktop” workflow.
Test plan
CI=1 npx vitest run --environment jsdom src/app/session/hooks/use-external-session-refresh.test.tsnpx eslint src/app/session/hooks/use-external-session-refresh.ts src/app/session/hooks/use-external-session-refresh.test.ts src/app/desktop-controller.tsxnpm run type-checknpm run buildReview notes
A first review found a race where a poll could start while idle, then overwrite an optimistic/in-flight prompt if the session became busy before the persisted read returned. The final implementation rechecks runtime session state after the awaited read and includes a regression test for that race.