Skip to content

fix(web): pass owning profile when loading session messages - #44162

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/web-dashboard-profile-messages
Closed

fix(web): pass owning profile when loading session messages#44162
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/web-dashboard-profile-messages

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the web dashboard failing to load session transcripts for sessions belonging to non-default profiles. The getSessionMessages() API call was missing the ?profile= query parameter, causing the backend to search the default profile's state.db and return 404.

Related Issue

Fixes #44147

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • web/src/lib/api.ts: Add optional profile parameter to getSessionMessages() that appends ?profile=... when present. Add profile?: string | null to SessionInfo interface.
  • web/src/pages/SessionsPage.tsx: Pass session.profile when calling getSessionMessages() in the session row expand handler. Add session.profile to the useEffect dependency array.

How to Test

  1. Create a named Hermes profile and start a session in it (e.g. via hermes --profile myprofile chat)
  2. Open the web dashboard and navigate to the Sessions page
  3. Verify the session from the named profile appears in the session list (requires /api/profiles/sessions endpoint)
  4. Expand the session row — the transcript should load successfully instead of showing "Session not found"
  5. Verify sessions in the default profile still load correctly (no regression)

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Code Intelligence

⚠️ GitNexus unavailable for web/ TypeScript — grep-based fallback used.

  • Checked: web/src/lib/api.ts (getSessionMessages caller sites: 1 in SessionsPage.tsx)
  • Blast radius: LOW — optional parameter, backward-compatible, single call site
  • Related patterns: Desktop already passes profile in apps/desktop/src/hermes.ts:getSessionMessages(id, profile?)

When a session belongs to a non-default profile, the web dashboard's
getSessionMessages() called /api/sessions/{id}/messages without the
profile query parameter. The backend then searched the default
profile's state.db and returned 404 Session not found.

Add optional profile parameter to getSessionMessages() and the
SessionInfo interface, and pass session.profile from SessionsPage
when expanding a session row. The backend already accepts
?profile=... on this endpoint — only the frontend wiring was missing.

Fixes NousResearch#44147
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have 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 #44162

Verdict: Approved — clean multi-profile session loading fix.

Summary

  • Files changed: web/src/lib/api.ts, web/src/pages/SessionsPage.tsx (+9, -4)
  • Adds optional profile parameter to getSessionMessages() API call
  • Passes session.profile when expanding a session row, fixing 404 for non-default profile sessions

Assessment

Correctness: The profile parameter is correctly threaded through. The ternary pattern preserves backward compatibility for sessions without a profile field.

No issues found.


Reviewed by Hermes Agent

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused profile-routing fix. Current main already provides this behavior through broader dashboard session scoping; this is an automated hermes-sweeper review.

  • Commit 62b4618e9 (fix(dashboard): scope sessions and analytics to selected profile, fix(dashboard): scope sessions and analytics to selected profile #45598) makes web/src/lib/api.ts:342-356 pass the selected management profile to both getSessions() and getSessionMessages().
  • hermes_cli/web_server.py:3967-4056 opens the selected profile's session database for listing, and hermes_cli/web_server.py:9746-9772 does the same for transcript reads.
  • tests/hermes_cli/test_web_server.py:1255-1293 covers listing and reading a named profile's session via ?profile=worker.
  • The implementation shipped in v2026.6.19.

@teknium1 teknium1 closed this Jul 14, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Web dashboard cannot load messages for non-default profile sessions

4 participants