Skip to content

OpenSearchVectorStore: no reconnect persistence — hidden by MagicMock #846

Closed

Description

@AmitoVrito

Summary

OpenSearchVectorStore (src/synapsekit/retrieval/opensearch_vector.py), previously only MagicMock-tested, returned [] after a reconnect. Found via a real opensearchproject/opensearch testcontainer (epic #829). (Async is fine — it offloads via run_in_executor — and the k-NN mapping works on real OpenSearch 2.17.)

Bug

No reconnect persistence — search() returned [] whenever not self._index_created and self._dims is None, so a freshly reconnected instance never found already-indexed vectors.

Fix

Drop the guard; _search_sync returns [] on NotFoundError (covers search-before-add and reconnect).

Test

Real opensearchproject/opensearch:2.17 testcontainer: true nearest-neighbour k-NN ranking, metadata filter, top_k, reconnect persistence, empty/negative, async contract. Replaces the MagicMock test; runs in the CI integration job.

Part of epic #829.

Activity

  1. added this to the v2.0.1 milestone on Jul 21, 2026
  2. added
    bug
    retrieval
    v2.0.1
    on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugretrievalv2.0.1

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions