Skip to content

fix(desktop): pin unscoped stream events - #48281

Closed
rayjun wants to merge 1 commit into
NousResearch:mainfrom
rayjun:fix/desktop-unscoped-stream-routing
Closed

fix(desktop): pin unscoped stream events#48281
rayjun wants to merge 1 commit into
NousResearch:mainfrom
rayjun:fix/desktop-unscoped-stream-routing

Conversation

@rayjun

@rayjun rayjun commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • pin unscoped Desktop stream events to the session that received message.start
  • keep subsequent unscoped deltas, tool/status events, and completion on that originating session after the user switches chats
  • preserve explicit session_id routing and drop behavior for unscoped subagent.* events

Fixes #47709.

Testing

  • npm --workspace apps/desktop run test:ui -- src/lib/gateway-events.test.ts
  • npm --workspace apps/desktop run typecheck
  • npm --workspace apps/desktop exec eslint -- src/lib/gateway-events.ts src/lib/gateway-events.test.ts src/app/session/hooks/use-message-stream.ts
  • git diff --check

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

Copy link
Copy Markdown
Collaborator

Related: #47743 (open competing fix for the same desktop session-bleed family, via resolveGatewayEventSessionId + resetViewSync routing). This PR takes a different mechanism — pinning unscoped stream events to the session that received message.start. Both target #47709. Maintainer should pick one mechanism; this PR is the focused 3-file version (#47743 is a whole-fork push with contaminated unrelated files).

@alt-glitch alt-glitch added comp/desktop Electron desktop app (apps/desktop/*) sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state and removed comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 26, 2026
@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded — rebased onto the current `use-message-stream/` split and folded in `resetViewSync` from #47743 so a stale RAF stage can’t repaint after New Session. Co-authored-by preserved. Thanks for the focused pin approach.

@OutThisLife

Copy link
Copy Markdown
Collaborator

Superseded — see the salvage PR linked above.

OutThisLife added a commit that referenced this pull request Jul 13, 2026
Live deltas from session A were attaching to session B after New Session
when events arrived without session_id — fallback used the newly focused
activeSessionId (#47709).

Pin unscoped stream events to the session that received message.start
(#48281). Also reset RAF-pending view staging on new/resume/create so a
stale background flush cannot repaint over the switched chat (#47743).

Co-authored-by: Ray <rayjun0412@gmail.com>
Co-authored-by: zapabob <1920071390@campus.ouj.ac.jp>
OutThisLife added a commit that referenced this pull request Jul 13, 2026
fix(desktop): pin unscoped streams + clear view sync on switch (supersedes #48281)
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
Live deltas from session A were attaching to session B after New Session
when events arrived without session_id — fallback used the newly focused
activeSessionId (NousResearch#47709).

Pin unscoped stream events to the session that received message.start
(NousResearch#48281). Also reset RAF-pending view staging on new/resume/create so a
stale background flush cannot repaint over the switched chat (NousResearch#47743).

Co-authored-by: Ray <rayjun0412@gmail.com>
Co-authored-by: zapabob <1920071390@campus.ouj.ac.jp>
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
…281-stream-pin

fix(desktop): pin unscoped streams + clear view sync on switch (supersedes NousResearch#48281)
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
Live deltas from session A were attaching to session B after New Session
when events arrived without session_id — fallback used the newly focused
activeSessionId (NousResearch#47709).

Pin unscoped stream events to the session that received message.start
(NousResearch#48281). Also reset RAF-pending view staging on new/resume/create so a
stale background flush cannot repaint over the switched chat (NousResearch#47743).

Co-authored-by: Ray <rayjun0412@gmail.com>
Co-authored-by: zapabob <1920071390@campus.ouj.ac.jp>
randlee pushed a commit to randlee/hermes-agent that referenced this pull request Aug 11, 2026
…281-stream-pin

fix(desktop): pin unscoped streams + clear view sync on switch (supersedes NousResearch#48281)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Desktop shows newer session output in an older session

3 participants