Skip to content

fix(desktop): stop stale sessions when starting a new chat - #48371

Closed
ygc3817922006-sketch wants to merge 1 commit into
NousResearch:mainfrom
ygc3817922006-sketch:fix/desktop-new-chat-stale-sessions
Closed

fix(desktop): stop stale sessions when starting a new chat#48371
ygc3817922006-sketch wants to merge 1 commit into
NousResearch:mainfrom
ygc3817922006-sketch:fix/desktop-new-chat-stale-sessions

Conversation

@ygc3817922006-sketch

Copy link
Copy Markdown

Summary

  • Stop stale runtime sessions when starting a new desktop chat.
  • Prevent background workers from an abandoned/new-chat transition from leaking into the next thread.

Test Plan

  • cd apps/desktop && npm run test:ui -- src/app/session/hooks/use-session-actions.test.tsx
  • cd apps/desktop && npm run typecheck
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have labels Jun 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #39211 and #47743 (open desktop new-chat / session-bleed fixes). Those address render contamination (stale bubbles/busy rows, unscoped event routing); this PR closes the previous runtime session (session.close) when starting a fresh draft to stop background workers leaking into the next thread. Same new-chat stale-session family, different mechanism -> related, not duplicate.

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Note: This is NOT a duplicate of the prior closed PRs (#39211, #47743). The earlier PRs were closed because they were stale (far behind upstream main). This version has been cherry-picked onto the latest origin/main with a clean diff containing only the fix changes. No conflicts. CI green. Ready for review.

@ygc3817922006-sketch ygc3817922006-sketch closed this by deleting the head repository Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants