fix(desktop): prevent composer busy stuck on session resume - #41907
Closed
jarv1s-csn wants to merge 1 commit into
Closed
fix(desktop): prevent composer busy stuck on session resume#41907jarv1s-csn wants to merge 1 commit into
jarv1s-csn wants to merge 1 commit into
Conversation
Add a 30-second safety kill switch that resets the busy state after session resume, preventing the composer send button from getting permanently stuck in "running" state when: - The gateway reports a session as running (e.g. after non-normal close) - session.info fires during resume and re-applies busy=true via RAF - isCurrentResume() guard blocks the finally-block cleanup Closes NousResearch#41901
tonydwb
approved these changes
Jun 8, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Analysis
Correctness ✅
- The fix adds a 30-second safety timeout that resets the busy state if resume stalls or navigates away. This is a reasonable defensive measure.
- The timeout is properly cleaned up in the
finallyblock viaclearTimeout(resumeBusyTimer)when resume completes normally.
Code Quality ✅
- Minimal change (9 lines) with clear inline comment explaining the motivation.
Testing ✅
- No new tests, but this is a defensive timeout — the fix is simple enough that testing the timeout behavior would require artificial delays.
Recommendation
Approve — targeted safety fix that prevents UX stuck states.
This was referenced Jun 13, 2026
Contributor
|
Thanks for the focused desktop recovery patch. This is an automated hermes-sweeper review; current
The PR's original file was subsequently split into |
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
Fix a bug where the composer send button gets permanently stuck in "running" state when clicking on a historical session in the desktop app.
Root Cause
Two interacting issues cause the stuck busy state:
Race between
session.infoandsession.resume: WhenresumeSession()finishes, it setsbusy: falseviaupdateSessionState. But if asession.infoevent withrunning: truefires during the resume, its RAF-scheduledflushPendingViewState()can re-applybusy: trueafter the resume already set it to false.No safety net: If
isCurrentResume()returnsfalsein thefinallyblock (e.g. user navigated away mid-resume),busyis never reset.Fix
Added a 30-second
setTimeoutkill switch right aftersetBusy(true)inresumeSession(). The timer is cleared in thefinallyblock on normal completion. If the resume flow hangs, errors, or theisCurrentResume()guard prevents cleanup, the timer resetsbusyafter 30 seconds — guaranteeing the composer recovers.Test Plan
Related
apps/desktop/src/app/session/hooks/use-session-actions.ts