Repository navigation
fix(ima): route search folder-name hits away from document hydration - #2332
Merged
pancacake merged 1 commit intoNov 5, 2026
Merged
Conversation
search_knowledge returns folder matches inside info_list with a folder_ media id and media_type 99, and no folder_id. Those were parsed as documents, so retrieval spent the hydration budget on get_media_info failures and reported content_unavailable. Fixes HKUDS#2326
This was referenced Nov 2, 2026
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.
Description
search_knowledgereturns folder-name matches insideinfo_listwith afolder_media_idandmedia_type99, and nofolder_id.parse_knowledge_page()only treated an entry as a folder when it hadfolder_idand nomedia_id, so these hits were parsed as documents.Retrieval then tried to hydrate them with
get_media_info, failed withImaAPIError, spent the hydration budget, and returnedcontent_unavailableeven when real documents had matched.Document-array entries with a
folder_media id ormedia_type99 are now routed to the folder list and are never hydrated. A search that only hits folder names reportsno_matches.Related Issues
Module(s) Affected
servicestestsChecklist
dev(notmain).Additional Notes
This change was AI-assisted and was reviewed and tested.
Parser regression: a live-shaped
info_listentry (media_idfolder_7359,media_type99, empty highlight, nofolder_id) is a folder, and a real document in the same page stays a document. Thefolder_prefix andmedia_type99 each suffice on their own. A media id offolderwithmedia_type1 stays a document.Pipeline regression: four folder-name hits ahead of a title-only document do not call
get_media_contentfor the folders; the document is hydrated and the result isready. Folder-only results reportno_matcheswith no media fetches.