Skip to content

feat(honcho): add session-write dedup and platform metadata stripping #9404

@NewTurn2017

Description

@NewTurn2017

Summary

docs/honcho-integration-spec.md explicitly calls out several openclaw-honcho patterns that Hermes should adopt back: message dedup (lastSavedIndex) and platform metadata stripping before Honcho storage. The current Honcho plugin already has async prefetch, dynamic reasoning, identity seeding, and session naming, but it still appears to write session messages without a dedup cursor and without a dedicated metadata-stripping layer.

Evidence

Docs

  • docs/honcho-integration-spec.md:92-98
    • lastSavedIndex dedup
    • platform metadata stripping
  • docs/honcho-integration-spec.md:338-349
    • openclaw-honcho checklist lists these as already-done there and not yet re-implemented in Hermes

Current implementation

  • plugins/memory/honcho/session.py:324-359
    • _flush_session() gathers all local unsynced messages and sends them via honcho_session.add_messages(...)
    • no lastSavedIndex-style persisted cursor was found
  • repo search did not find lastSavedIndex in the Python implementation
  • repo search did not find a Honcho-specific platform metadata stripping layer or equivalent normalizer near the Honcho sync path

Problem

Without a persisted dedup cursor and a metadata hygiene layer:

  • replay / duplication risk is higher across restarts, reloads, and rehydration paths
  • transport-specific metadata may leak into long-term memory if it enters message content or wrappers upstream
  • Hermes Honcho storage is less robust than the documented target architecture

Scope

  1. Add a persisted dedup mechanism for Honcho session writes
    • equivalent to lastSavedIndex semantics or a stronger cursor-based variant
  2. Ensure replays / restored local history do not resend already-synced messages
  3. Add platform metadata stripping / normalization before Honcho persistence
    • remove adapter-only transport noise
    • keep user/assistant semantic content intact
  4. Add tests for restart/reload/retry scenarios and dedup correctness

Acceptance criteria

  • Repeated flushes cannot duplicate previously synced messages after process restart or cache rebuild
  • Honcho persistence path strips platform-only metadata before storage
  • Tests cover duplicate-prevention and metadata hygiene
  • docs/honcho-integration-spec.md can be updated to mark these Hermes backports complete

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstype/featureNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions