fix(search): agent-agentic 500 + regenerate stale e2e seed/tests#357
Open
gloryfromca wants to merge 2 commits into
Open
fix(search): agent-agentic 500 + regenerate stale e2e seed/tests#357gloryfromca wants to merge 2 commits into
gloryfromca wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two related fixes to the search subsystem's e2e coverage, split into two commits.
1.
fix(search)— agent-agentic 500POST /api/v*/memory/searchwithowner_type=agent+method=agenticreturned 500. The agent AGENTIC path fed recall candidates straight into everalgo'saagentic_retrieve, whose_format_docs(the LLM sufficiency / multi-query prompt) requiresmetadata["episode"]as a{subject, content}dict + a ms-epochtimestamp. Agent-kind rows carry their body in the recaller'stext_fieldand time as adatetime, so_format_docsraisedTypeError: 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 e2eThe committed
search_seedfixture and several search e2e tests were written for the pre-1.5 memcell fact-linkage model. Current extraction linksatomic_fact.parent_id == episode.entry_id(parent_type="episode"), anduser_memoryclusters store episodeentry_idmembers. The stale fixture made VECTOR/AGENTIC recall + cluster narrowing find nothing.search_seed/*from a fresh corpus in current entry_id format; facts bridge across multiple episodes._dump_search_seed.pysampling (pick fact-hosting episodes first; keep facts by entry_id) so re-dumps stay coherent.INVALID_INPUTcode.ome.tomlin the full-app pipeline fixture (OME config reloader requires it; strategies are code-registered so the packaged default suffices), unblocking corpus regeneration.Verification
make lint(ruff + import-linter + datetime + openapi), unit (1569), integration (79) all green.Notes
-m 'not slow and not live_llm'); this PR restores them to green for local/manual runs. No product behavior change beyond the agent-agentic 500 fix.🤖 Generated with Claude Code