hermes - 💡(How to fix) Fix Feature: compact session continuity handoff after auto-reset [1 pull requests]

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…

Add compact session continuity after gateway auto-reset so long-lived/project bots do not wake up with avoidable amnesia.

When a gateway starts a fresh session because of an automatic reset (daily or idle), the first real user turn in the new session should receive a compact, explicit handoff from the parent session. This should be a continuity summary, not raw transcript replay.

Root Cause

When a gateway starts a fresh session because of an automatic reset (daily or idle), the first real user turn in the new session should receive a compact, explicit handoff from the parent session. This should be a continuity summary, not raw transcript replay.

Fix Action

Fixed

Code Example

session_handoff:
  mode: none | notice | last_n | summary
  last_messages: 12
  max_chars: 20000
RAW_BUFFERClick to expand / collapse

Summary

Add compact session continuity after gateway auto-reset so long-lived/project bots do not wake up with avoidable amnesia.

When a gateway starts a fresh session because of an automatic reset (daily or idle), the first real user turn in the new session should receive a compact, explicit handoff from the parent session. This should be a continuity summary, not raw transcript replay.

Motivation

Project bots often span days. Today, an automatic reset can make the bot lose the working thread even though the prior session exists locally. The result is avoidable context amnesia: the user expects continuity, while the bot only sees a clean session plus durable memory.

Related prior work / discussion:

  • #12857 — bug report around discarded context after auto-reset.
  • #5810 — feature request for context carry / continuity.
  • #12890 — directionally related but too broad/noisy; a surgical compact-handoff approach should avoid full transcript duplication and large blast radius.
  • #30945 — generic upgrade/onboarding decision framework. Session continuity is a candidate consumer, but the behavior spec belongs here.

Proposed behavior

On automatic session reset, Hermes should preserve a link from the new child session to the previous parent session and inject a compact handoff before the first user message is interpreted.

The handoff should answer:

It is now a new day/session. What should the agent know before interpreting the next user message?

Keep the explicit bridge metadata:

  • current local date/time at the moment of the user's first message in the new session;
  • elapsed time since the last activity in the parent session;
  • reset reason, e.g. daily or idle;
  • parent session identifier for audit/debugging;
  • an explicit warning that the handoff is background only and prior requests must not be continued unless the user reactivates them.

Replace raw "recent conversation" carryover with an objective-based continuity summary. This should be closer to Hermes context compaction than to transcript replay: preserve meaning, decisions, unresolved work, and what the bot needs to interpret the next user message.

Recommended summary sections, aligned with existing context compaction:

  • Active Task — latest unfulfilled user request, if any.
  • Goal — what the user was trying to accomplish overall.
  • Constraints & Preferences — relevant user constraints, style, safety, project rules.
  • Completed Actions — concrete actions already taken, with outcomes.
  • Active State — current working state, branch/path/test/process/config facts that matter.
  • In Progress — work that was underway when the reset happened.
  • Blocked — unresolved blockers or errors.
  • Key Decisions — decisions made and why.
  • Resolved Questions — questions already answered so the bot does not repeat them.
  • Pending User Asks — unanswered/unfulfilled user requests.
  • Relevant Files — files/repos/configs touched or important.
  • Remaining Work — loose ends/open loops/likely next asks, framed as context rather than instructions.
  • Critical Context — exact values/errors/config facts that would otherwise be lost, with secrets redacted.

The summarization focus should be explicit: daily/project continuity, loose ends, unresolved asks, and what the bot needs before interpreting the user's first message after reset.

Non-goals

  • Do not replay the full transcript into the new session.
  • Do not treat old user requests as active instructions.
  • Do not inject tool/system noise unless it is summarized as a relevant outcome.
  • Do not silently enable this for all users without an explicit decision path; see #30945.

Suggested config shape

session_handoff:
  mode: none | notice | last_n | summary
  last_messages: 12
  max_chars: 20000

Expected modes:

  • none: current behavior; no handoff.
  • notice: metadata-only warning that an auto-reset happened.
  • last_n: bounded recent user/assistant turns; useful as scaffolding/debug mode, not the ideal project-bot mode.
  • summary: objective-based continuity handoff using the compaction-style structured summary above, plus bridge metadata. This is the intended project-bot mode.

Implementation notes

A surgical implementation should include:

  • SessionEntry.parent_session_id
  • SessionEntry.parent_updated_at
  • persistence through session store serialization/deserialization
  • parent linkage set when an automatic reset creates a fresh child session
  • gateway injection before normal first-turn context after auto-reset
  • transcript filtering/summarization that ignores tool/system noise by default
  • reuse or refactor the existing context compaction summarizer/template where practical instead of creating a parallel pseudo-summary path
  • use an explicit focus topic such as: daily/project continuity, loose ends, unresolved asks, and what the bot needs before interpreting the first post-reset user message
  • failure-safe fallback to notice if summary construction fails

If LLM summarization is used, it should be bounded and cost-aware. A deterministic extractive fallback is useful, but it should still produce objective continuity sections rather than raw transcript replay.

Acceptance criteria

  • Auto-reset child sessions record the parent session id and parent updated timestamp.
  • First real user message after auto-reset receives handoff context before the agent interprets the message.
  • Handoff includes current local time and elapsed time since parent activity.
  • Summary mode uses the objective-based compaction-style structure, not raw recent-message regurgitation.
  • Summary mode includes continuity summary and loose ends/open loops.
  • Prior-session requests are explicitly marked as background only, not active instructions.
  • Tool/system noise is excluded from raw carryover.
  • Config defaults remain backward-compatible, with behavior-changing enablement handled through #30945 or explicit config.
  • Focused tests cover daily/idle reset, parent persistence, handoff rendering, truncation, and gateway injection path.

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