fix(ingestion): align zep-ingest with server-assigned UUIDs - #600
Conversation
Stop accepting client node/fact UUIDs (API rejects/ignores them), surface Zep-assigned identities on IngestResult in zip-safe order, and bump to 0.2.0. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Critical
- ingestion/src/zep_ingest/result.py,
_param_identity_prefixhunk around new lines 183–196: identity recovery stops permanently at the first task without the requested identity field. A failed task, or a mixed task type (for example, a node task while collecting edges), never gains that field, so UUIDs from all later successful tasks remain inaccessible even afterwait()completes. Preserve task-position gaps withNone, or track identities by task ID and only defer entries for nonterminal tasks. Add tests covering a failed or different-type task followed by a successful task.
Stop treating terminal tasks without identities like in-flight ones so edge_uuids/node_uuids still collect later successes with None gaps. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
- Critical —
ingestion/src/zep_ingest/result.py,_sync_identities_from_task_params()hunk:edge_uuidsis rebuilt solely fromtask_ids, butingest_fact_triples()adds no task ID or placeholder when a submission fails or returns no task handle. Thus, if triple 0 fails submission and triple 1 succeeds, the latter’s UUID appears atedge_uuids[0], violating the documented alignment with submitted triples and potentially associating an edge with the wrong input. Track one slot per submitted triple, including submission failures/untracked responses, and map task IDs to those slots rather than deriving the list directly fromtask_ids. Add a regression test covering an early submission failure followed by a successful triple.
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
-
Critical —
ingestion/src/zep_ingest/result.py,_param_identity_prefixhunk:edge_uuidsis aligned only withtask_ids, not with submitted triples. If an earlieradd_fact_triplecall fails during submission, no task ID or placeholder is recorded; a later successful triple’s UUID shifts into the failed triple’s position. This contradicts the documented input-parallel contract and can associate facts with the wrong source records. Preserve the original submission index—e.g. addNoneimmediately for submission failures/untracked calls and update UUIDs by task-to-input mapping rather than rebuilding solely fromtask_ids. -
Warning —
ingestion/pyproject.toml:3andingestion/tests/test_basic.pyversion-test removal: The package version becomes0.2.0, butzep_ingest.__init__still falls back to0.1.0when distribution metadata is unavailable. Removing the version test hides this inconsistency, so source-tree imports report the previous release. Update the fallback to0.2.0and retain a test covering it.
Summary
NodeItem.uuid/FactTriple.fact_uuid/require_uuids, matching the API that assigns identities server-side.IngestResult.node_uuidsandedge_uuids, kept zip-safe across partial failures and out-of-order task completion.zep-cloudto>=3.27.0; update README/CHANGELOG/tests.Test plan
pytest -m 'not integration'iningestion/ingest_nodeswithout client UUIDs returns parallelnode_uuidsingest_fact_triples+wait()populatesedge_uuidsintask_idsorderuuid/fact_uuidraise ConfigurationErrorMade with Cursor