feat(sessions): add --source flag for third-party session isolation#3208
Closed
HenkDz wants to merge 1 commit intoNousResearch:mainfrom
Closed
feat(sessions): add --source flag for third-party session isolation#3208HenkDz wants to merge 1 commit intoNousResearch:mainfrom
HenkDz wants to merge 1 commit intoNousResearch:mainfrom
Conversation
…\nWhen third-party tools spawn Hermes as a subprocess, their sessions\npollute the user session history and search results.\n\nThis adds:\n\n- `hermes chat --source <tag>` CLI flag (also via HERMES_SESSION_SOURCE env var)\n- `exclude_sources` parameter on list_sessions_rich() and search_messages()\n- Sessions with source=tool are hidden from sessions list/browse/search by default\n\nThird-party adapters should pass --source tool to keep agent sessions separate.
teknium1
pushed a commit
that referenced
this pull request
Mar 26, 2026
When third-party tools (Paperclip orchestrator, etc.) spawn hermes chat as a subprocess, their sessions pollute user session history and search. - hermes chat --source <tag> (also HERMES_SESSION_SOURCE env var) - exclude_sources parameter on list_sessions_rich() and search_messages() - Sessions with source=tool hidden from sessions list/browse/search - Third-party adapters pass --source tool to isolate agent sessions Cherry-picked from PR #3208 by HenkDz.
teknium1
added a commit
that referenced
this pull request
Mar 26, 2026
…3255) When third-party tools (Paperclip orchestrator, etc.) spawn hermes chat as a subprocess, their sessions pollute user session history and search. - hermes chat --source <tag> (also HERMES_SESSION_SOURCE env var) - exclude_sources parameter on list_sessions_rich() and search_messages() - Sessions with source=tool hidden from sessions list/browse/search - Third-party adapters pass --source tool to isolate agent sessions Cherry-picked from PR #3208 by HenkDz. Co-authored-by: Henkey <noonou7@gmail.com>
Contributor
|
Merged via PR #3255. Your commit was cherry-picked onto current main with authorship preserved. Two small bugs were fixed on top (source/exclude_sources SQL conflict and getattr guard for non-list subcommands) and 9 tests added. Thanks for the contribution! |
StreamOfRon
pushed a commit
to StreamOfRon/hermes-agent
that referenced
this pull request
Mar 29, 2026
…ousResearch#3255) When third-party tools (Paperclip orchestrator, etc.) spawn hermes chat as a subprocess, their sessions pollute user session history and search. - hermes chat --source <tag> (also HERMES_SESSION_SOURCE env var) - exclude_sources parameter on list_sessions_rich() and search_messages() - Sessions with source=tool hidden from sessions list/browse/search - Third-party adapters pass --source tool to isolate agent sessions Cherry-picked from PR NousResearch#3208 by HenkDz. Co-authored-by: Henkey <noonou7@gmail.com>
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.
Problem
When third-party tools (like Paperclip orchestrator) spawn
hermes chatas a subprocess, their agent sessions pollute the user's CLI session history,hermes sessions list,hermes sessions browse, andsession_searchresults.Solution
Add a
--source <tag>flag tohermes chatthat tags sessions with a custom source identifier. Sessions tagged withsource=toolare filtered out from user-facing session lists and search by default.Changes
hermes chat --source <tag>: New CLI flag (also settable viaHERMES_SESSION_SOURCEenv var, same pattern as--yolo)hermes_state.py: Addedexclude_sourcesparameter tolist_sessions_rich()andsearch_messages()session_search_tool.py: Added_HIDDEN_SESSION_SOURCESconstant; recent sessions and FTS5 search excludesource=toolby defaulthermes_cli/main.py:sessions listandsessions browseexcludetoolsessions by defaultcli.py+run_agent.py: ReadHERMES_SESSION_SOURCEenv var, falling back to"cli"Usage for third-party adapters
Backwards compatible
source=toolsessions which don't exist yethermes sessions list --source toolContext
Companion PR: hermes-paperclip-adapter will pass
--source toolwhen spawning Hermes.