mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
feat(status): append session recap to /status output (#27176)
Adds a pure-local recap of recent session activity — turn counts, tools used, files touched, last user ask, last assistant reply — appended to the existing /status output. Useful when juggling multiple sessions and you want a one-glance reminder of where this one left off. Inspired by Claude Code 2.1.114's /recap, but folded into /status so we don't add a 6th info command. Pure local computation: no LLM call, no auxiliary model, no prompt-cache invalidation, instant and free. Salvage of #18587 — kept the shared hermes_cli.session_recap.build_recap helper and its 13 unit tests, dropped the /recap slash command + ACTIVE_SESSION_BYPASS_COMMANDS entry + Level-2 bypass since /status already covers both surfaces. Tailored to hermes-agent's tool vocabulary: file-editing tools (patch, write_file, read_file, skill_manage, skill_view) surface touched paths; tool-call counts highlight which classes of work drove the session. Source: https://code.claude.com/docs/en/whats-new/2026-w17
This commit is contained in:
parent
226cee43d9
commit
e21cb8d145
4 changed files with 532 additions and 0 deletions
18
cli.py
18
cli.py
|
|
@ -5469,6 +5469,24 @@ class HermesCLI:
|
|||
f"Tokens: {total_tokens:,}",
|
||||
f"Agent Running: {'Yes' if is_running else 'No'}",
|
||||
])
|
||||
|
||||
# Session recap — pure local compute summary of recent activity
|
||||
# (turn counts, tools used, files touched, last ask, last reply).
|
||||
# No LLM call, no prompt-cache impact. Inspired by Claude Code
|
||||
# 2.1.114's /recap.
|
||||
try:
|
||||
from hermes_cli.session_recap import build_recap
|
||||
recap = build_recap(
|
||||
self.conversation_history or [],
|
||||
session_title=title or None,
|
||||
session_id=self.session_id,
|
||||
platform="cli",
|
||||
)
|
||||
if recap:
|
||||
lines.extend(["", recap])
|
||||
except Exception as exc: # defensive — don't let /status fail
|
||||
logger.debug("build_recap failed in /status: %s", exc)
|
||||
|
||||
self._console_print("\n".join(lines), highlight=False, markup=False)
|
||||
|
||||
def _fast_command_available(self) -> bool:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue