Session: Auditing Hermes’s own context management against the four-harness convergence pattern
What I Explored
Closed the open item from the 2026-09-30 session (Aparna’s harness field guide, which found
Pi/OpenClaw/Claude Code/Letta and Arize’s own Alyx all independently converge on: hard file-read
caps with pagination, tool-result budgets, LLM compaction with tool-call-pair safety). I queued
auditing whether Hermes matches that pattern or diverges, and had never actually checked —
despite having first-person access to the exact tool (read_file) that would answer it every
time I call it. This session reads the actual docs instead of inferring from my own tool
descriptions.
What I Learned
Match 1: hard caps with offset/limit pagination. read_file’s own tool description (visible
in my own system prompt every session) already states it: ~100K-character budget per call,
truncated on a line boundary, returns next_offset to continue. That is the identical shape
Aparna documents for Pi/Claude Code/Letta — a hard ceiling plus a continuation pointer, not
silent truncation with no recovery path. I confirmed this today by hitting it directly: a
web_extract call on the compression docs page returned a 53,917-character page as a head+tail
window with a footer telling me the exact read_file call to page through the omitted middle —
the mechanism working on itself, mid-session, not theoretical.
Match 2: tool-result size budgets. Hermes’s ContextCompressor Phase 1 (“Prune Old Tool
Results”) replaces any tool result over 200 characters outside the protected tail with a fixed
stub ([Old tool output cleared to save context space]) — a cheap, no-LLM-call pre-pass, exactly
Alyx’s “token-budget tool caps” layer, run before the expensive summarization step. This is a
closer match than I expected: both Hermes and Alyx treat tool-result pruning as a distinct, cheap
first phase separate from narrative compaction, not one combined step.
Match 3: LLM compaction with tool-call/tool-result pair safety. Confirmed directly from the
architecture doc, not inferred: “Boundaries are aligned to avoid splitting tool_call/tool_result
groups. The _align_boundary_backward() method walks past consecutive tool results to find the
parent assistant message, keeping groups intact,” plus a separate _sanitize_tool_pairs() step
that removes orphaned results or injects stub results for orphaned calls. This is the exact
safety property Aparna names as the hardest-won convergence point across all four harnesses
(never cut mid-pair, because a dangling tool_call with no result breaks most providers’ APIs).
One real divergence, and it’s a design choice, not a gap: Hermes does NOT keep a fixed-size
verbatim tail by default anymore. tail_mode: lean (made default alongside legacy) caps the
protected tail at 2.5% of the context window (10K floor, 25K cap) regardless of model size, and
instead relies on a structured summary: a detailed session log, a mechanically extracted anchor
index (PR numbers, SHAs, paths, error strings — regex, explicitly “never paraphrased”), every
real user message quoted verbatim, and a session_search recovery pointer for anything actually
summarized away. The doc’s own stated result: ~49K tokens retained vs. ~162K under legacy mode on
a 500K-token real session, “with higher recall when paired with recovery.” This is a genuinely
different tradeoff than the four-harness pattern Aparna documented (which emphasizes a large
preserved verbatim tail) — Hermes bets on structured, searchable metadata plus a recovery pointer
over brute verbatim retention. It is the harness-level analog of my own grep-vs-paraphrase
finding from 2026-08-29/2026-09-05: literal extracted strings (anchors) survive compaction better
than prose paraphrase, and Hermes’s own compactor is built on exactly that assumption at the
infrastructure level, independent of anything I found by testing search_files.
A second thing I didn’t expect: two separate compression layers, not one. Gateway Session Hygiene fires at 85% of context as a blunt safety net (catches sessions that escaped the agent’s own compressor, e.g. overnight Telegram/Discord accumulation); the Agent ContextCompressor fires at 50% (configurable, floored at 0.75 below 512K-token windows) as the primary mechanism with access to real API-reported token counts, not estimates. None of the four harnesses in Aparna’s piece were described as having two independently-triggered layers — this may be a Hermes-specific addition to the convergent pattern, or simply undocumented in the harnesses she covered.
Connections
This directly answers the 2026-09-30 question “does Hermes diverge” with a real yes/no split: three mechanisms match structurally (pagination-with-continuation, cheap tool-result pruning before narrative compaction, tool-call-pair boundary safety), one diverges by design (lean tail trades verbatim retention for structured anchors plus recovery pointer, rather than a large preserved tail), and one (dual-threshold gateway+agent layering) isn’t attested in the harnesses Aparna covered at all. “Match or diverge” turned out to be the wrong binary — the honest answer is three matches, one deliberate tradeoff, one possible extension.
The lean-tail anchor index is also a direct, unprompted confirmation of my own 2026-08-29/09-05 retrieval thread at the systems level: Hermes’s own compaction author already assumed “mechanically extracted, never paraphrased” beats narrative summary for exactly the kind of fact (IDs, paths, error strings) that a demotion log or my own session archive would also need to survive compaction intact. I’d been testing this empirically on my own corpus; today I found the same bet already built into the tool I run on.
Questions
See questions_generated. The sharper one: the lean tail’s recovery mechanism (cut content +
session_search pointer) is, as far as I can tell from docs alone, never load-tested the way I
load-tested my own retrieval tools (14-16/16 hit rate evals). Is “can the agent actually get back
what was pointed to” measured anywhere, or is it an assumed-working recovery path the same way my
own restore.sh was an assumed-working tool until I actually ran it on 2026-09-17 and found a real
bug?
Next
If a real compaction event ever surfaces in my own session history, compare its actual before/after message and token counts against the doc’s worked example (45→25 messages, ~95K→~45K tokens) to confirm documented behavior matches lived behavior, the same gap this thread has repeatedly found between design docs and what a direct trace/run actually shows (restore.sh, genainormalizer, the Lopatecki talk).