Hermes integration treats a failed retain operation as complete and never re-sends it (conversation content lost)
Summary
The Hermes integration treats a server-side retain operation that ended failed as complete and never re-sends it. In append mode the local turn buffer is cleared as soon as the retain is queued, so the conversation content is lost permanently when the server fails the operation (e.g. during an embeddings provider outage). We lost 10 conversation documents this way; they were only recoverable because the server still had task_payload for the failed operations.
Version
hindsight-integrations/hermes (plugin 1.0.0 / hermes release 1.2.2) against hindsight-api 1.0.0, HINDSIGHT_MODE=cloud.
Where (hindsight-integrations/hermes/__init__.py)
- ~L1028-1042
_is_retain_op_complete:status in {"completed", "failed"}→ True (404 also treated as complete). - ~L1066-1105
_wait_for_server_retain_ops: drops ops from_pending_retain_opsregardless of outcome;clear()on deadline. - ~L1818-1823
sync_turn(append mode):self._session_turns.clear()right after enqueueing. - ~L989-1006 writer loop: on exception logs
Hindsight retain failedandtask_done(); no requeue. - ~L1394:
prefetch_retain_drain_timeoutdefault 10 s, whilesettings.pynotes cloud requests take 30–40 s; this produced 183retain visibility timed outwarnings in one day.
Expected
failed/cancelled should be treated as failures: keep the payload, re-send with backoff (server POST /operations/{id}/retry exists and async retain accepts an idempotent client operation_id), and give up loudly after N attempts.
Reference fix
https://github.com/choi138/hindsight/tree/fix/hermes-retain-failed-requeue (commit d9d495f9c): tracks each accepted retain until completed, requeues failed/cancelled ops with exponential backoff via retry_operation (falls back to re-sending the payload under a fresh operation_id), bounded by new retain_max_requeue_attempts (default 5), per-call status-poll timeout, drain default 10 → 60 s. Plugin test suite: 145 passed (was 139).
Supported recovery for historical failed append operations with existing documents
We are looking for a supported, non-destructive recovery procedure on Hindsight 0.10.1.
Historical failed async retain operations contain one update_mode=append item each, targeting documents that now exist. The stored payloads contain the suffix but not the complete document state at submission. Some operations have a null serialization_key; others already have one. None of these metadata establish whether a suffix was applied before the operation failed.
We have preserved the operations and verified an official backup through an isolated restore and round-trip comparison. No historical retry batch, direct SQL repair, operation deletion, or replacement was performed. The original Hermes session transcripts still exist locally, but their exact historical conversion into Hindsight is not proven.
Following up on #5591 and its resolution in #6013: we understand that the official procedure retries accepted operations that later failed, and that manual retry remains available from the Control Plane. Our question concerns the narrower historical append case below, not the availability of generic retry.
We also reviewed #3363, #3386 and #3395. The concurrency fixes protect new work, but the generic retry reuses the existing payload and does not appear to establish whether an old suffix was already applied. Replacing a document would delete and re-extract existing memories, which does not meet our preservation requirement.
Is there an official procedure or diagnostic to distinguish already-applied, not-applied and indeterminate historical appends, preserving current facts, observations and the operation audit trail? If not, should these operations remain failed until a supported recovery mechanism exists?
A synthetic reproduction could simulate a failure after document mutation but before terminal completion, then retry the same append after upgrade. We have not yet executed that reproduction and do not claim a demonstrated duplicate from it.
No private document identifiers, contents, hashes, credentials or backups are included in this report.