Skip to content

fix(memory): gate update_mode='append' on features.store_document_text - #90470

Open
Robs87 wants to merge 1 commit into
NousResearch:mainfrom
Robs87:fix/hindsight-append-capability-gate
Open

Robs87 wants to merge 1 commit into
NousResearch:mainfrom
Robs87:fix/hindsight-append-capability-gate

Conversation

@Robs87

@Robs87 Robs87 commented Aug 20, 2026

Copy link
Copy Markdown

Problem

The Hindsight memory plugin gates update_mode='append' on version number only (_MIN_VERSION_FOR_UPDATE_MODE_APPEND = 0.5.0). A server at >=0.5.0 that has document text storage disabled (features.store_document_text=false) still rejects appends:

update_mode='append' is not supported when document text storage
(store_document_text / HINDSIGHT_API_STORE_DOCUMENT_TEXT) is disabled

Result: every retain fails, last_memory_write_at goes permanently stale, and the bank accumulates failed retain/batch_retain operations — with only a "Prefetch: server retain visibility timed out" WARNING on the agent side (no ERROR), so the outage is easy to miss.

Root cause

_check_api_supports_update_mode_append() probes /version and reads only the version string, ignoring the features.store_document_text field the server already reports. The plugin used to be feature-aware (falling back to per-process document_id without update_mode); the version-only gate regressed that behavior.

Fix

  • Probe /version once per process via new _fetch_hindsight_api_meta(), parsing both version and features.
  • Treat features.store_document_text=false as no append support: fall back to the per-process unique document_id with no update_mode, matching the legacy-server path.

Tests

  • Updated the three capability tests to mock the new probe (_fetch_hindsight_api_meta).
  • Added a regression test: >=0.5.0 server with store_document_text=false must fall back to per-process doc_id without update_mode.

Verified live against a Hindsight 0.9.0 server with store_document_text=false: probe now returns "append not supported" and retain falls back correctly. 108 hindsight-related tests pass.

The hindsight memory plugin decides update_mode='append' capability by
version number only (_MIN_VERSION_FOR_UPDATE_MODE_APPEND = 0.5.0). A
server at >=0.5.0 with features.store_document_text=false still rejects
appends ("update_mode='append' is not supported when document text
storage is disabled"), so every retain fails and last_memory_write_at
goes permanently stale.

Probe /version once per process, parse features.store_document_text, and
treat store_document_text=false as "no append support": fall back to the
per-process unique document_id without update_mode, restoring the
feature-aware behavior that predated the version-only gate.

Tests: update capability mocks to the new probe and add a regression
test covering a >=0.5.0 server with store_document_text=false.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins tool/memory Memory tool and memory providers area/memory Memory subsystem: store, providers, sync, background reviews sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state duplicate This issue or pull request already exists labels Aug 20, 2026
@alt-glitch

Copy link
Copy Markdown
Contributor

This was generated by AI during triage.

Duplicate of #84819. Both patches address append retains against text-storage-disabled Hindsight configuration; #84819 is the broader canonical implementation because it resolves the effective per-bank policy and safely fails closed when it cannot be determined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/memory Memory subsystem: store, providers, sync, background reviews comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants