Skip to content

[codex] fix desktop profile session reads - #44185

Closed
Evisolpxe wants to merge 1 commit into
NousResearch:mainfrom
Evisolpxe:codex/fix-desktop-profile-session-reads
Closed

[codex] fix desktop profile session reads#44185
Evisolpxe wants to merge 1 commit into
NousResearch:mainfrom
Evisolpxe:codex/fix-desktop-profile-session-reads

Conversation

@Evisolpxe

Copy link
Copy Markdown
Contributor

Summary

Fix Desktop session reads for sessions owned by non-default profiles.

The backend already exposes the owning profile on /api/profiles/sessions, and transcript reads work when Desktop sends /api/sessions/{id}/messages?profile={profile}. Several Desktop entry points still used the legacy single-profile /api/sessions list or dropped the profile before reading messages, which made non-default-profile sessions fail with 404 Session not found.

What changed

  • Use listAllProfileSessions for Desktop session picker, command palette, archived sessions settings, and artifacts scans.
  • Pass the owning profile through message reads and session export.
  • Include request.profile on getSessionMessages so Electron can route the request consistently while the backend still receives ?profile=.
  • Add a bounded resume fallback that resolves a routed session id from the cross-profile session list when the in-memory sidebar store does not already contain the row.
  • Match compressed lineage root ids when resolving, deleting, archiving, or hydrating session rows.

Validation

  • npm run test:ui -- src/hermes.test.ts
  • npm run typecheck
  • Targeted ESLint on changed Desktop files
  • npm run build

Note: full npm run lint currently reports pre-existing unrelated errors outside this diff; the changed files pass targeted lint.

@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery labels Jun 11, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review: PR #44185

Verdict: Approved — multi-entry-point profile scoping fix for Desktop session reads.

Summary

Files changed: 9 apps/desktop files (+88, -27)

Fixes Desktop session reads for non-default profiles across 9 entry points: artifacts, command palette, session picker, archived settings, desktop controller, session actions, and session export. Uses listAllProfileSessions and passes profile through message reads.

Assessment

Correctness: Consistent profile threading across all Desktop entry points. The bounded resume fallback that resolves from cross-profile session list prevents 404s when the sidebar store doesn't have the row. Matches lineage root ids correctly.

No issues found.


Reviewed by Hermes Agent

@OutThisLife

Copy link
Copy Markdown
Collaborator

Salvaged into #44529 — your commit is cherry-picked there with authorship preserved (rebased over main's newer applyRuntimeInfo / applyStoredSessionPreviewRuntimeInfo refactor in use-session-actions.ts). Premise verified against the backend (/api/profiles/sessions at web_server.py:2539, ?profile= on message reads at web_server.py:6333) and validated (npm run test:ui -- src/hermes.test.ts 3/3, full desktop platform suite green). Closing in favor of the consolidated PR — thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery 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.

4 participants