EverOS icon indicating copy to clipboard operation
EverOS copied to clipboard

case→skill bridge matches index row ids against md-side source_case_ids

Open gloryfromca opened this issue 1 month ago • 1 comments

memory/search/manager.py (_bridge_skills, around line 749) collects Candidate.id of the matched cases — the index row id, shaped <agent_id>_ac_<date>_<seq> — and passes them to AgentSkillRecaller.fetch_by_case_ids, which filters contains("source_case_ids", …). The source_case_ids written into SKILL.md frontmatter are md-side entry ids, shaped ac_<date>_<seq> (verified on a real root). The two shapes never match, so the bridge may never have returned a skill.

Not verified by a test yet; found while reading the id composition for the primary-key fix. Needs: a failing test that writes a case + a skill referencing it and asserts the bridge returns the skill, then the fix (compare on entry_id, or store row ids in frontmatter).

gloryfromca avatar Oct 09 '26 08:10 gloryfromca

I'd like to take this. I'll add the failing test first: a case with entry_id ac_... and a skill whose source_case_ids contains it, asserting the bridge returns the skill. The fix will carry the md-side entry_id into bridge_cases; SearchAgentCaseItem doesn't expose it today, so I'd either add a private _entry_id or have the internal case search return the raw candidates. Do you have a preference?

chuiwenwei avatar Oct 18 '26 11:10 chuiwenwei