Skip to content

fix(desktop): refresh externally written sessions - #70183

Closed
Futahua wants to merge 1 commit into
NousResearch:mainfrom
Futahua:agent/external-session-refresh
Closed

fix(desktop): refresh externally written sessions#70183
Futahua wants to merge 1 commit into
NousResearch:mainfrom
Futahua:agent/external-session-refresh

Conversation

@Futahua

@Futahua Futahua commented Jul 23, 2026

Copy link
Copy Markdown

What changed

Hermes Desktop now reconciles the bounded local session list every five seconds while visible. The reconciliation is guarded against overlapping requests and retains the existing last-known list on transient failures.

Why

Sessions written by another local Hermes surface, such as the CLI, TUI, or a phone companion, update the authoritative state.db but do not emit on the current Desktop renderer websocket. The sidebar therefore remained stale until Desktop restarted.

Impact

Externally-created local sessions appear in the normal Desktop sidebar without navigation, focus changes, or an application restart.

Validation

  • full Desktop TypeScript typecheck passed
  • ESLint passed for the modified hook
  • production Desktop build and unpacked package succeeded
  • live acceptance: with Desktop open, an external CLI session was created and the sidebar count changed from 10 to 11 without restarting

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

@GottZ GottZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Summary

Two PRs address external Desktop session updates, but at different layers: #37766 refreshes the selected transcript and messaging list, while #70183 reconciles the general bounded sidebar session list for sessions created by other local Hermes surfaces.

Related pull requests

  • #37766 [closed] related — (+415/-0) — keep closed as implemented on main: it adds guarded active-transcript read repair, revision checks, and busy-state race protection; contributor verification confirms the equivalent, including profile-aware reads and visibility refresh, was merged in #57636.
  • #70183 related — (+36/-2) — merge: it adds a non-overlapping five-second visible poll of refreshSessions, specifically covering externally created local CLI/TUI/phone-companion sessions that the already-merged active messaging-session refresh does not reconcile into the general sidebar list.

Suggested consolidation

Merge #70183 because its diff closes the remaining general sidebar-list gap and complements rather than duplicates the active messaging transcript implementation already merged via #57636. Keep #37766 closed as superseded by that merged implementation; no additional duplicate PR needs closing.

Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 17 kB of PR diffs, 2 kB of issue/PR text, 2 kB of discussion (3 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing the externally-written session-list gap. This is an automated hermes-sweeper review; current main now provides the requested behavior through a broader event-driven implementation.

  • tui_gateway/server.py:3059 watches state.db and state.db-wal as the cross-process signal and broadcasts sessions.changed.
  • apps/desktop/src/app/contrib/hooks/use-background-sync.ts:299 consumes that signal and coalesces refreshSessions() for the stored sidebar list.
  • This shipped via merged PR Desktop: event-driven live sync — gateway change broadcasts replace the always-on polls #73673 (fe64cafa33b5631da7fb911b1803da86407b0ebd; merge 6c2a3b4bb2f63b24539e28f5644aae0bb88e9b5c).
  • tests/tui_gateway/test_change_watcher.py:55 verifies state.db changes emit sessions.changed, including trailing-edge preservation for coalesced writes.

@teknium1 teknium1 closed this Jul 30, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 30, 2026
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:implemented-on-main Sweeper: behavior already present on current main 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.

4 participants