Skip to content

fix(stage-router): recognize Hermes compaction - #951

Merged
ryan-lempka merged 1 commit into
mainfrom
fix/hermes-compaction-marker
Oct 7, 2026
Merged

ryan-lempka merged 1 commit into
mainfrom
fix/hermes-compaction-marker

Conversation

@ryan-lempka

@ryan-lempka ryan-lempka commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Stage already keeps compacted conversations on the capable model, but it did not recognize Hermes' compaction headers. This change recognizes Hermes' summary and resumed-task headers and applies the existing compaction override. Verified with real Hermes compaction through Switchyard using a scripted model endpoint: requests after compaction now stay on the capable model, while earlier routing stays unchanged. All local tests and checks pass.

Summary by CodeRabbit

  • Bug Fixes
    • Compaction summaries are now recognized for both Claude Code and Hermes, including when they appear within user or assistant messages. Existing Claude Code marker detection is preserved, while tool-result content does not trigger compaction detection.

Signed-off-by: Ryan Lempka <rlempka@nvidia.com>
@ryan-lempka
ryan-lempka requested a review from a team as a code owner October 7, 2026 21:52
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://NVIDIA-NeMo.github.io/Switchyard/pr-preview/pr-951/

Built to branch gh-pages at 2026-10-07 21:53 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA-NeMo/Switchyard/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 632aba37-66fd-4807-bdee-3225d626b562
📥 Commits

Reviewing files that changed from the base of the PR and between 2bd647e and e361811.

📒 Files selected for processing (1)
  • crates/libsy/src/algorithms/util/tool_signals.rs

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 10 remain after this review.


Walkthrough

Compaction detection now recognizes two Hermes summary headers in user and assistant text, in addition to the existing Claude Code marker. Tests cover matching cases and text that must not trigger detection.

Changes

Compaction Detection

Layer / File(s) Summary
Hermes header detection and tests
crates/libsy/src/algorithms/util/tool_signals.rs
The detector lowercases text and checks whether a trimmed line starts with either Hermes header. Tests cover user and assistant messages, existing text, tool-result exclusions, and non-matching text.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Merge Risk: ⚪ Minimal · up to e3618

The pinned Hermes compaction summary matches the new detector, so the intended capable-model routing remains available. No actionable merge-blocking risk is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: recognizing Hermes compaction in the stage router.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each line with care,
Two Hermes headers meet the snare.
Claude's marker keeps its place,
Tool results pass without a trace.
The test burrow rests, all clear.

Comment @coderabbitai help to get the list of available commands.

@ryan-lempka
ryan-lempka merged commit 3cf60ce into main Oct 7, 2026
19 checks passed
@ryan-lempka
ryan-lempka deleted the fix/hermes-compaction-marker branch October 7, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants