feat: per-user profile routing for messaging platforms - #33558
Closed
samuelperezh wants to merge 1 commit into
Closed
feat: per-user profile routing for messaging platforms#33558samuelperezh wants to merge 1 commit into
samuelperezh wants to merge 1 commit into
Conversation
Add SLACK_USER_PROFILE_MAP (and {PLATFORM}_USER_PROFILE_MAP) env var
that maps platform user IDs to Hermes profiles, so a single bot can
route different users to fully isolated agent profiles.
- Add hermes_cli/profile_context.py: reusable profile context manager
extracted from cron/scheduler.py's _job_profile_context, with
resolve_user_profile() helper for platform-agnostic routing
- Refactor cron/scheduler.py: _job_profile_context now delegates to
the shared profile_context(), maintaining its _hermes_home wrapper
- gateway/run.py: resolve per-user profile before agent run, enter
profile context (HERMES_HOME override + .env loading), restore on
exit in the finally block
Closes NousResearch#33548
This was referenced May 28, 2026
Author
|
@alt-glitch can we merge this to main? |
Contributor
|
Thanks for the concrete profile-isolation proposal. This automated hermes-sweeper review is closing it because its user-facing configuration mechanism conflicts with a standing policy.
Closed as not-planned per standing maintainer policy ( |
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
Adds
{PLATFORM}_USER_PROFILE_MAPenvironment variable that maps platform user IDs to Hermes profiles, enabling a single bot to route different users to fully isolated agent profiles.Changes
hermes_cli/profile_context.py— reusable profile context manager extracted from cron/scheduler.py, withresolve_user_profile()helper for platform-agnostic routingcron/scheduler.py—_job_profile_contextnow delegates to sharedprofile_context(), keeping its_hermes_homewrappergateway/run.py— resolve per-user profile before agent run, enter profile context (HERMES_HOME override + .env loading), restore on exitHow to use
# .env SLACK_USER_PROFILE_MAP=U01ADMIN:default,U01TEAM:automationsWhen a message arrives from
U01TEAM, the gateway enters theautomationsprofile context, loading its config, model, toolsets, memory, and .env. On exit, the original environment is fully restored.Testing
profile_contextimport and unit tests passresolve_user_profilemaps users correctly_job_profile_context(cron) works with refactored codeCloses #33548