hermes - ✅(Solved) Fix [Bug]: CLI command to resume conversation from a previous session [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#11793Fetched 2026-04-18 05:58:49
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Participants
Timeline (top)
commented ×1cross-referenced ×1labeled ×1referenced ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #11868: fix(cli): redirect resume status lines to stderr in quiet mode (#11793)

Description (problem / solution / changelog)

Summary

When hermes chat --quiet --resume <id> -q "..." is used, three status messages were written to stdout via ChatConsole / _cprint:

  • ↻ Resumed session <id> (N user messages, M total messages)
  • Session <id> found but has no messages. Starting fresh.
  • Session not found: <id> / usage hint

This polluted the machine-readable stdout that automation scripts capture with $(...), making it impossible to cleanly separate the agent's answer from the resume banner.

Root cause

_init_agent() prints these messages unconditionally through the Rich console path (ChatConsole().print()_cprint()_pt_print() → stdout). Quiet mode only gates agent-internal output; the CLI's own resume diagnostics were not covered.

Fix

Detect quiet mode via getattr(self, "tool_progress_mode", "full") == "off" (set at line 10381 in the quiet-mode path before _init_agent() is called) and route all three messages to stderr as plain text — matching the existing convention for session_id:. Interactive mode is unchanged; it still renders through the Rich ChatConsole path.

Test plan

Tested on v0.10.0 (sha256:9f37fa3ff8d8d83ab9e1b529b1373c598c377b61ecdb90e26c3d310bf04f5904):

# Turn 1 — quiet single-shot (session history is persisted correctly)
SESSION=$(hermes chat --quiet -q "My favourite colour is blue." 2>&1 \
          | grep session_id | awk '{print $2}')

# Turn 2 — quiet resume
STDOUT=$(hermes chat --quiet --resume "$SESSION" \
         -q "What is my favourite colour? One word." 2>/dev/null)
echo "$STDOUT"   # Blue  ← only the answer, no banner

# stderr now carries the resume status (not mixed into stdout)
hermes chat --quiet --resume "$SESSION" \
  -q "What is my favourite colour? One word." 2>&1 >/dev/null
# stderr: ↻ Resumed session ... (N user messages, M total messages)
#         session_id: ...

Note: the underlying session persistence (SQLite write + resume read) was verified to be working correctly in v0.10.0. Both user and assistant messages are saved after a successful quiet single-shot turn, and --resume correctly restores them. The stdout pollution is the only confirmed bug in current code.

Closes #11793

🤖 Generated with Claude Code

Changed files

  • cli.py (modified, +30/-11)

Code Example

# Turn 1, send a message and capture the session ID
hermes chat --quiet -q "My favourite colour is blue and I hate red."

echo "Session ID: $SESSION_ID"

# Turn 2, resume and ask about the prior turn
hermes chat --quiet --resume "$SESSION_ID" -q "What is my favourite colour?"

---

(clarify timed out after 120s — agent will decide)
I don't have any information about your colour preferences.
session_id: 20260417_162721_1bf485

---

hermes chat --quiet --resume 20260417_162721_1bf485 -q "What did we talk about in this session?"
# Response: "So far we've only exchanged a brief introductory exchange..."

---

Report     https://paste.rs/y3J9Z
agent.log  https://paste.rs/hB4TD

---
RAW_BUFFERClick to expand / collapse

Bug Description

When running a single-shot query with hermes chat --quiet -q "...", Hermes prints a session_id: line but does not save the conversation history to SQLite. As a result, passing that session ID to --resume on the next call starts a completely fresh session with no memory of the prior turn.

Steps to Reproduce

# Turn 1, send a message and capture the session ID
hermes chat --quiet -q "My favourite colour is blue and I hate red."

echo "Session ID: $SESSION_ID"

# Turn 2, resume and ask about the prior turn
hermes chat --quiet --resume "$SESSION_ID" -q "What is my favourite colour?"

Expected Behavior

Turn 2 should answer "blue" from the conversation history saved in turn 1.

Actual Behavior

Turn 2 responds as if no prior conversation exists:

(clarify timed out after 120s — agent will decide)
I don't have any information about your colour preferences.
session_id: 20260417_162721_1bf485

Confirmed by asking directly:

hermes chat --quiet --resume 20260417_162721_1bf485 -q "What did we talk about in this session?"
# Response: "So far we've only exchanged a brief introductory exchange..."

Affected Component

CLI (interactive chat)

Messaging Platform (if gateway-related)

No response

Debug Report

Report     https://paste.rs/y3J9Z
agent.log  https://paste.rs/hB4TD

Operating System

Ubuntu 24

Python Version

No response

Hermes Version

No response

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

FIX: hermes chat --quiet -q should flush the full conversation (both the user message and the assistant response) to SQLite before exit, identical to how interactive mode persists sessions. The printed session_id: implies persistence is intended as the write just isn't happening.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be fixed by modifying the hermes chat --quiet -q command to flush the full conversation to SQLite before exit, ensuring session persistence.

Guidance

  • Verify that the hermes command is correctly configured to use the SQLite database for storing conversation history.
  • Check the agent.log for any errors or warnings related to database connections or writes.
  • Test the hermes chat command in interactive mode to see if conversation history is persisted correctly.
  • Consider adding a debug flag to the hermes chat --quiet -q command to enable verbose logging and help identify the issue.

Example

No code snippet is provided as the issue does not contain sufficient information about the internal workings of the hermes command.

Notes

The proposed fix suggests modifying the hermes chat --quiet -q command to flush the conversation to SQLite, but without more information about the implementation, it's difficult to provide a specific solution.

Recommendation

Apply workaround: Modify the hermes chat --quiet -q command to flush the conversation to SQLite before exit, as described in the proposed fix. This should ensure that conversation history is persisted correctly, allowing subsequent --resume commands to access the prior conversation.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: CLI command to resume conversation from a previous session [1 pull requests, 1 comments, 2 participants]