Skip to content

fix(bridge): derive profileId dynamically from MEMOS_HOME#1949

Open
redashes1984 wants to merge 1 commit into
MemTensor:mainfrom
redashes1984:fix/bridge-profile-resolution
Open

fix(bridge): derive profileId dynamically from MEMOS_HOME#1949
redashes1984 wants to merge 1 commit into
MemTensor:mainfrom
redashes1984:fix/bridge-profile-resolution

Conversation

@redashes1984

Copy link
Copy Markdown

name: Bug Fix
about: Create a report to help us improve

Issue: dist/bridge.cjs missing dynamic profileId resolution from bridge.cts

Problem

The bridge.cts source file hardcoded profileId: "default", causing all profile-specific data to be invisible in the memOS web viewer when using multi-profile Hermes setups.

Root Cause

  • bridge.cts hardcoded profileId: "default" in bootstrapMemoryCoreFull() call
  • The Python adapter already derives profileId correctly from HERMES_HOME
  • This bug only affects the Node.js bridge process (HTTP viewer)

Symptoms

  • Web Viewer only shows data from default profile
  • Database has thousands of records for other profiles (e.g., nova)
  • Agent tool calls work correctly (Python adapter resolves profileId dynamically)
  • Problem is ONLY in the standalone HTTP viewer bridge process

Environment

  • Hermes Agent v0.13+
  • memos-local-plugin v2.0.19
  • Profile: nova under multi-profile setup (~/.hermes/profiles/nova/)

Expected Behavior

bridge.cts should derive profileId dynamically from MEMOS_HOME environment variable.

Actual Behavior

bridge.cts hardcodes profileId: "default", filtering out all profile-specific data.

Fix

Added deriveProfileId() function that:

  1. Reads MEMOS_HOME environment variable
  2. Parses profile name from path pattern: /profiles/<name>/
  3. Falls back to "default" if MEMOS_HOME is not set or path doesn't match

Impact

  • Zero for single-profile/default setups (still resolves to "default")
  • Fixes all multi-profile Hermes setups

Testing

  • Tested on Hermes v0.13+, memos-local-plugin v2.0.19, profile nova (~19K traces)
  • All profile-specific data now visible in web viewer
  • Database owner_profile_id values correctly resolved

Workaround (for users who cannot upgrade)

Manually patch dist/bridge.cjs or update database owner_profile_id values to match the profile name.

Fix: bridge.cts hardcoded profileId: "default", causing all profile-specific
data to be invisible in the memOS web viewer for non-default profiles.

The Python adapter already derives profileId correctly from HERMES_HOME.
This change mirrors that logic in the Node.js bridge.

- Add deriveProfileId() function that parses profile name from MEMOS_HOME path
- Parse /profiles/<name>/ pattern to extract profile identifier
- Fallback to "default" if MEMOS_HOME is not set or path does not match
- Impact: zero for single-profile/default setups (still resolves to "default")

Fixes profile resolution issue reported by nova profile users.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant