fix(desktop): scope session list to active profile; harden gateway startup/turn persistence#41103
Merged
Conversation
Persist the inbound user turn before provider/tool execution so a crash before run_conversation() (e.g. provider/httpx client init failure) keeps the inbound message in the transcript. Repair stale/missing SSL_CERT_FILE state on gateway startup, and avoid duplicate gateway fallback writes.
The desktop sidebar fetched the unified cross-profile session list as profile='all' and filtered it client-side by the active profile. On a large multi-profile install the active profile's rows could be windowed out of the cross-profile recency page entirely, so switching to a profile agent showed an empty history panel (and the 'all' fetch could exceed the 15s IPC timeout on startup). Scope the fetch to the active profile so its own page comes back on its merits, and bump the session-list IPC timeout to 60s. profileScope is now a refreshSessions dep, so the existing gateway-open effect re-pulls on profile switch.
373efb8 to
ebdc174
Compare
Contributor
🔎 Lint report:
|
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
Switching to a profile agent in the Desktop app no longer empties the session-history panel. Salvage of #40550 (@bmoore210) onto current
main— all four concerns, contributor authorship preserved per-commit.The desktop bug (reported by @Semah____): on a global-remote, single-host install (one gateway, all profiles on it, no per-profile remote URLs), switching from the default agent to a profile agent like RAAD showed an empty history panel. Root cause: the sidebar fetched the unified session list as
profile='all'and filtered it client-side, so a profile with few recent sessions got windowed out of the cross-profile recency page entirely. Scoping the fetch to the active profile fixes it (and also fixes the startupHermes couldn't starttimeout on large multi-profile installs, where theallfetch exceeded the 15s IPC limit).Changes
apps/desktop/src/app/desktop-controller.tsx: scoperefreshSessionsto the active profile (profileScope) instead of always'all';profileScopeis now auseCallbackdep, so the existing gateway-open effect re-pulls on profile switch. Cron-exclusion preserved.apps/desktop/src/hermes.ts: 60s IPC timeout for both session-list calls.apps/desktop/src/hermes.test.ts: cover the timeout.agent/conversation_loop.py: persist the inbound user turn before provider/tool execution (idempotent via_last_flushed_db_idx) so a pre-run_conversationcrash keeps the message.gateway/run.py: repair stale/missingSSL_CERT_FILE; dedup-guarded crash-persist of the inbound user message on early agent failure.scripts/release.py: AUTHOR_MAP entry for @bmoore210 (CI email gate).Validation
tests/run_agent/test_413_compression.py+test_860_dedup.py+tests/gateway/test_ssl_cert_detection.pyapps/desktoptsc --noEmitapps/desktopvitest run src/hermes.test.tsget_profiles_sessions(profile='raad')total:1/profile_totals:{raad:1}— confirms the scoped fetch populates the panel even when default dominates recencySalvaged from #40550. Cherry-picked onto current
main, conflicts indesktop-controller.tsx(cron-exclusion) andhermes.ts(source params) resolved to keep bothmain's additions and the PR's change. Authorship preserved via per-commit--author.Infographic