Skip to content

fix(search): agent-agentic 500 + regenerate stale e2e seed/tests#357

Open
gloryfromca wants to merge 2 commits into
mainfrom
fix/search-seed-parent-linkage
Open

fix(search): agent-agentic 500 + regenerate stale e2e seed/tests#357
gloryfromca wants to merge 2 commits into
mainfrom
fix/search-seed-parent-linkage

Conversation

@gloryfromca

Copy link
Copy Markdown
Collaborator

What

Two related fixes to the search subsystem's e2e coverage, split into two commits.

1. fix(search) — agent-agentic 500

POST /api/v*/memory/search with owner_type=agent + method=agentic returned 500. The agent AGENTIC path fed recall candidates straight into everalgo's aagentic_retrieve, whose _format_docs (the LLM sufficiency / multi-query prompt) requires metadata["episode"] as a {subject, content} dict + a ms-epoch timestamp. Agent-kind rows carry their body in the recaller's text_field and time as a datetime, so _format_docs raised TypeError: Candidate ... has no episode dict.

Fix mirrors the episode path's bridge: reshape agent candidate metadata into the everalgo doc contract before aagentic_retrieve, then revert it before DTO shaping. Other agent methods (keyword/vector/hybrid) and user-memory agentic were unaffected.

2. test(search) — regenerate stale seed + migrate e2e

The committed search_seed fixture and several search e2e tests were written for the pre-1.5 memcell fact-linkage model. Current extraction links atomic_fact.parent_id == episode.entry_id (parent_type="episode"), and user_memory clusters store episode entry_id members. The stale fixture made VECTOR/AGENTIC recall + cluster narrowing find nothing.

  • Regenerated search_seed/* from a fresh corpus in current entry_id format; facts bridge across multiple episodes.
  • Fixed _dump_search_seed.py sampling (pick fact-hosting episodes first; keep facts by entry_id) so re-dumps stay coherent.
  • Migrated e2e tests to the entry_id model (hierarchical-eviction, session/timestamp filters, cluster-seed helper); updated the filter-error assertion to the current INVALID_INPUT code.
  • Provisioned ome.toml in the full-app pipeline fixture (OME config reloader requires it; strategies are code-registered so the packaged default suffices), unblocking corpus regeneration.

Verification

  • Full search e2e suite: 49/49 green (live LLM/rerank/embedder).
  • make lint (ruff + import-linter + datetime + openapi), unit (1569), integration (79) all green.

Notes

🤖 Generated with Claude Code

zhanghui and others added 2 commits July 24, 2026 15:21
The agent AGENTIC path (`agent_case` / `agent_skill`) fed recall
candidates straight into `aagentic_retrieve`, whose `_format_docs`
(LLM sufficiency / multi-query prompt) reads `metadata["episode"]` as a
`{subject, content}` dict plus a ms-epoch `timestamp`. Agent-kind rows
carry their body in the recaller's `text_field` and time as a datetime,
so `_format_docs` raised `TypeError: Candidate ... has no episode dict`
and `POST /api/v*/memory/search` returned 500 for any
`owner_type=agent` + `method=agentic` request.

Mirror the episode path's bridge: reshape agent candidate metadata into
the everalgo doc contract before `aagentic_retrieve`, and revert it
before DTO shaping so the agent shapers still see a datetime timestamp.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The committed `search_seed` fixture and several search e2e tests were
written for the pre-1.5 memcell fact-linkage model. Current extraction
links atomic_facts to episodes via `parent_id == episode.entry_id`
(parent_type="episode"), and user_memory clusters store episode
entry_id members — so the stale fixture made VECTOR/AGENTIC recall and
the cluster-narrowing path find nothing, and stale assertions checked
an old error code.

- Regenerate `search_seed/*` from a fresh corpus in the current
  entry_id format; facts now bridge across multiple episodes (richer
  agentic / hierarchical-eviction coverage).
- Fix `_dump_search_seed.py` sampling: pick episodes that host facts
  first and keep facts by episode entry_id, so re-dumps stay coherent.
- Migrate e2e tests to the entry_id model (hierarchical-eviction,
  session/timestamp filters, cluster seeding helper) and update the
  filter-error assertion to the current `INVALID_INPUT` code.
- Provision `ome.toml` in the full-app pipeline fixture (the OME config
  reloader requires it; strategies are code-registered so the packaged
  default suffices), unblocking corpus regeneration.

Full search e2e suite now green (49/49).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant