You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hermes chat --source <name> does not persist — sessions always recorded as source=cli #45107
Passing --source <name> to hermes chat has no effect on what gets stored in state.db: the session's source column is always cli. This breaks any
workflow that needs to distinguish tool-driven sessions from real user
sessions via SQL.
hermes chat --source distiller -q "Say OK and nothing else."
sqlite3 ~/.hermes/state.db \
"SELECT id, source FROM sessions ORDER BY created_at DESC LIMIT 1;"
We run a nightly batch "distiller" that reads conversation transcripts out of state.db and extracts durable facts. To avoid re-ingesting its own
prompts (a feedback loop), it filters WHERE s.source IS NOT 'distiller' —
but since --source never sticks, the filter is useless and every batch run
pollutes the next run's input set. We currently work around it with a
prompt-prefix guard (skip sessions whose first user message starts with a
known marker), but that's fragile, and the mislabeled sessions still
accumulate in state.db.
Any other programmatic consumer of hermes chat (cron jobs, CI, agent
pipelines) has the same problem: no reliable way to tag and later exclude
machine-generated sessions.
Notes
--source is accepted without error, so this looks like the value is parsed
but dropped before session creation rather than an unsupported flag.
Three closed PRs address #45107 by making the explicit HERMES_SESSION_SOURCE override the default platform during session creation. #45126 additionally applies that precedence to compression-rotated sessions and memory metadata, #45130 limits the change to the reported interactive-session path, and #45157 adds relaunch inheritance that conflicts with the documented current relaunch contract.
fix(cli): preserve --source across CLI self-relaunch (#45107) #45157[closed]fixes — (+75/-2) — partially redundant fix: Repeats the same persistence-precedence change, but also makes --source survive self-relaunch. It remains relevant for separating those concerns, but the contributor review documents that current main deliberately excludes --source from relaunch inheritance, so that additional change should not be merged.
Duplicates
#45126, #45130, and #45157 duplicate the core _ensure_db_session() precedence fix; #45130 is the narrowest duplicate, while #45126 adds related persistence paths and #45157 adds a distinct, rejected relaunch-inheritance change.
Suggested consolidation
Do not reopen or merge these closed PRs: use verify-selected #45126 as the best-fix/reference implementation for #45107, while respecting the contributor duplicate review that points to earlier #40866 and the later confirmation that the core behavior is already on main. #45130 can remain closed as a narrower duplicate, and #45157 can remain closed because its shared fix is redundant and its extra relaunch behavior conflicts with the documented repository design.
Complex graph
flowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I45107(["issue #45107 (open)"])
subgraph Dup45126 ["PRs duplicating each other"]
P45126["PR #45126 (closed)"]
P45130["PR #45130 (closed)"]
P45157["PR #45157 (closed)"]
end
P45126 -->|best fix| I45107
P45130 -->|fixes| I45107
P45157 -->|fixes| I45107
class I45107 open
class I45107 target
class P45126 closed
class P45130 closed
class P45157 closed
class P45126 best
click I45107 "https://github.com/NousResearch/hermes-agent/issues/45107"
click P45126 "https://github.com/NousResearch/hermes-agent/pull/45126"
click P45130 "https://github.com/NousResearch/hermes-agent/pull/45130"
click P45157 "https://github.com/NousResearch/hermes-agent/pull/45157"
Loading
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 16 kB of PR diffs, 8 kB of issue/PR text, 2 kB of discussion (5 comments), 7 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
Fixed on main. run_agent.py:59-72_session_source_for_agent() now reads HERMES_SESSION_SOURCEfirst and returns source or platform or "cli", and _ensure_db_session() uses it when creating the row (run_agent.py:335-359), so --source <name> is what gets persisted.
The change came in a7983d5 (2026-06-19, "fix(dashboard): hide sidecar sessions from history", #49269) — it replaced the old self.platform or os.environ.get(...) precedence that always won for platform. Not from the PRs referenced earlier in this thread. A later commit, 0010273 (2026-09-16), completes the -q interaction so an explicit --source survives the one-shot relabel.
One sibling still carries the old pattern: agent/background_review.py:700 does agent.platform or os.environ.get("HERMES_SESSION_SOURCE", "cli"). Harmless for the CLI path in this report (platform is falsy there), but it will mislabel if platform is ever set — worth a follow-up.
Activity
fix(cli): honor explicit --source over default cli platform (NousRese…
GottZ commentedon Jul 28, 2026
Summary
Three closed PRs address #45107 by making the explicit HERMES_SESSION_SOURCE override the default platform during session creation. #45126 additionally applies that precedence to compression-rotated sessions and memory metadata, #45130 limits the change to the reported interactive-session path, and #45157 adds relaunch inheritance that conflicts with the documented current relaunch contract.
Related pull requests
best fix— (+118/-3) — fixes, best-fix reference: Swaps source precedence in _ensure_db_session(), compression session rotation, and memory-write metadata, with database-backed regression coverage. It remains relevant as the broadest verified implementation, but was closed after contributor reviews identified it as a duplicate of earlier fix(session): honor --source flag in quiet/oneshot chat mode #40866.fixes— (+101/-1) — fixes, narrower duplicate: Applies the same _ensure_db_session() precedence swap and tests the direct interactive path, but does not cover the additional rotation and metadata paths changed by fix(cli): let --source flag override default platform in session creation #45126. It remains relevant as focused regression evidence, although contributors closed it as duplicate/implemented on main via the canonical fix(session): honor --source flag in quiet/oneshot chat mode #40866 path.fixes— (+75/-2) — partially redundant fix: Repeats the same persistence-precedence change, but also makes --source survive self-relaunch. It remains relevant for separating those concerns, but the contributor review documents that current main deliberately excludes --source from relaunch inheritance, so that additional change should not be merged.Duplicates
#45126, #45130, and #45157 duplicate the core _ensure_db_session() precedence fix; #45130 is the narrowest duplicate, while #45126 adds related persistence paths and #45157 adds a distinct, rejected relaunch-inheritance change.
Suggested consolidation
Do not reopen or merge these closed PRs: use verify-selected #45126 as the best-fix/reference implementation for #45107, while respecting the contributor duplicate review that points to earlier #40866 and the later confirmation that the core behavior is already on main. #45130 can remain closed as a narrower duplicate, and #45157 can remain closed because its shared fix is redundant and its extra relaunch behavior conflicts with the documented repository design.
Complex graph
flowchart LR classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151 classDef best stroke-width:3px,stroke:#b45309 classDef target stroke-width:3px,stroke:#4338ca I45107(["issue #45107 (open)"]) subgraph Dup45126 ["PRs duplicating each other"] P45126["PR #45126 (closed)"] P45130["PR #45130 (closed)"] P45157["PR #45157 (closed)"] end P45126 -->|best fix| I45107 P45130 -->|fixes| I45107 P45157 -->|fixes| I45107 class I45107 open class I45107 target class P45126 closed class P45130 closed class P45157 closed class P45126 best click I45107 "https://github.com/NousResearch/hermes-agent/issues/45107" click P45126 "https://github.com/NousResearch/hermes-agent/pull/45126" click P45130 "https://github.com/NousResearch/hermes-agent/pull/45130" click P45157 "https://github.com/NousResearch/hermes-agent/pull/45157"Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed or no verify verdict yet (state tag in the node label).
Cross-PR triage: Reviewed 3 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 16 kB of PR diffs, 8 kB of issue/PR text, 2 kB of discussion (5 comments), 7 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.
BrendanJMurphy commentedon Sep 17, 2026
Fixed on
main.run_agent.py:59-72_session_source_for_agent()now readsHERMES_SESSION_SOURCEfirst and returnssource or platform or "cli", and_ensure_db_session()uses it when creating the row (run_agent.py:335-359), so--source <name>is what gets persisted.The change came in a7983d5 (2026-06-19, "fix(dashboard): hide sidecar sessions from history", #49269) — it replaced the old
self.platform or os.environ.get(...)precedence that always won forplatform. Not from the PRs referenced earlier in this thread. A later commit, 0010273 (2026-09-16), completes the-qinteraction so an explicit--sourcesurvives the one-shot relabel.One sibling still carries the old pattern:
agent/background_review.py:700doesagent.platform or os.environ.get("HERMES_SESSION_SOURCE", "cli"). Harmless for the CLI path in this report (platform is falsy there), but it will mislabel ifplatformis ever set — worth a follow-up.