Skip to content

fix(hermes): preserve native context compaction - #4711

Closed
ScriptedAlchemy wants to merge 2 commits into
masterfrom
fix/hermes-native-compaction
Closed

ScriptedAlchemy wants to merge 2 commits into
masterfrom
fix/hermes-native-compaction

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

TraceDecay installation selected context.engine: tracedecay, but the installed engine always declined compression and returned the original transcript. Actual upstream Hermes selects that engine as its context compressor, so installing TraceDecay disabled automatic context-pressure compaction.

This change leaves Hermes' native or explicitly configured context engine selected. Activation repairs the old TraceDecay engine selection, while preserving other context settings. The memory provider continues transcript ingestion, and the seven lcm_* retrieval aliases register through the ordinary tool registry with the invoking session and project scope.

The inactive compressor implementation and its unused state/configuration are removed. Installer lifecycle tests and the existing plugin/stock-host harnesses now check native compaction and the independent retrieval surface.

Validation

  • Reproduced the original failure with the actual Hermes PluginManager and context-engine selector at NousResearch/hermes-agent@4131fd9: the selected TraceDecay engine declined compression at 128,000 tokens.
  • With the change, the actual native ContextCompressor responds at its 96,000/128,000-token threshold; actual registry dispatch of lcm_grep preserves the caller's session identity.
  • 22 embedded Python behavioral checks passed against the generated-template modules using a minimal catalogue fixture.
  • Modified Python sources, scripts, and embedded test bodies compile; git diff --check passes.
  • Rust renderer/host tests have not executed. The shared locked asupersync dependency's code generation was killed at this container's 8 GiB memory limit, including with one worker and the repository's existing bounded-test profile. A lower-memory Cargo check passed that dependency, then failed in unchanged tracedecay-graph-db: Cargo omits the repository's Grafeo Bazel patch, leaving four allocation-accounting methods unavailable. The host targets share this baseline dependency blocker; this PR stays draft until cargo test -p tracedecay-agent-hosts agents::hermes and cargo test -p tracedecay --features test-helpers --test hermes_suite can execute.

Implemented and reviewed with GPT-6 Astra Pro in ChatGPT.

@changeset-bot

changeset-bot Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e6db015

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Replace the forwarding closure with functools.partial so host call
configuration can override registration defaults without a TypeError.
Keep the existing project, profile and per-call session routing.

Exercise sequential registration, override, empty and explicit-None
configuration through the registered handler and actual synthesis path.
Replace a stale harness reference to the removed memory action constant
with checks against the canonical exact-route catalog.

Thirteen focused Python behavioral check groups pass with controlled
catalog/transport fixtures. Rust rendering, daemon and stock-host
integration remain unexecuted in this environment.

Copy link
Copy Markdown
Owner Author

Review follow-up pushed in e6db015.

  • Replaced the LCM forwarding closure with functools.partial. A host-provided per-call config previously collided with config=config and raised TypeError before dispatch. Call configuration now overrides registration defaults without changing the existing profile/project/session guard.
  • Repaired the harness's reference to removed MEMORY_FACT_ACTIONS; canonical catalog membership, collapsed schema, read-only selector refusal and missing-schema behavior remain checked.
  • Added a regression through actual registration, handler, argument translation, configuration layering and synthesis. It covers registered defaults, a call override, explicit None, an empty config, then reuse of the original defaults; outgoing session/user scope and captured Hermes home remain exact.

Validation: the baseline production closure fails the new regression with duplicate config; the old harness assertion fails with the removed-constant AttributeError. The fixed full Python module passes 13 focused behavioral check groups, including the five sequential configuration scenarios, using a minimal catalog fixture and substituted transport/auxiliary responses. Python parse and whitespace checks pass. Published blob hashes match the locally exercised files.

This is not a full generated-plugin/installer/daemon or stock-Hermes integration pass. Rust renderer and platform CI remain unexecuted locally because there is no Rust/Bazel toolchain. Keep the draft/CI requirements; no merge-readiness claim is made.

@ScriptedAlchemy

Copy link
Copy Markdown
Owner Author

Consolidated into #4742 (integrate/open-pull-requests) at the captured head shown in its description, as requested. Continue review and further fixes on #4742. This closure does not assert CI readiness; the replacement remains draft. Source branch retained.

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.

1 participant