Suggest: full-serialization fixes for feature-ai-rag (include_items + include_expansion) - #115
Open
reekitconcept wants to merge 2 commits into
Open
Suggest: full-serialization fixes for feature-ai-rag (include_items + include_expansion)#115reekitconcept wants to merge 2 commits into
reekitconcept wants to merge 2 commits into
Conversation
`serialize_brain()` serializes a small set of portal types in full via `ISerializeToJson` instead of from the catalog brain. plone.restapi resolves that to `SerializeFolderToJson` for any Dexterity container, which defaults to `include_items=True` - so for a folderish type every suggestion ran an extra catalog query and carried its complete child listing (`items`, `items_total`, `batching`) in the response. Nothing in the suggest UI consumes those keys, and suggest is a type-ahead endpoint, so the waste multiplies by keystrokes x suggestions on the one interaction that is meant to feel instant. Pass `include_items=False`. Plain `SerializeToJson` accepts and ignores the keyword, so no type check is needed and non-folderish types are unaffected. Also lift the inline `["Member"]` literal into `FULL_SERIALIZATION_TYPES`, so the behaviour is named and the tests can cover it without adding a `Member` content type to the fixtures. (cherry picked from commit 439e0bc)
Follow-up to the include_items fix cherry-picked from #106, per David's review comment on that PR: the full serialization also merged in expandable_elements(), so every fully serialized suggestion carried the @components dict (breadcrumbs, navigation, actions...) that the suggest dropdown never follows. Pass include_expansion=False alongside include_items=False. This commit is kept separate from the cherry-pick so it can itself be cherry-picked onto main for the v2 release, ahead of the feature branch merge.
davisagli
approved these changes
Aug 19, 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.
Fixes #114.
The feature branch forked from main on 2026-07-12, before #106 (fix for #105) landed on main (2026-08-10), so its
serialize_brain()still ran the full serialization with no keywords. Two commits, kept deliberately separate:include_items=False— no per-suggestion catalog query / embedded child listing for folderish types.include_expansion=False— no@componentsexpansion links (breadcrumbs, navigation, actions...) in the type-ahead payload, per @davisagli's review comment on Suggest: do not embed the child listing of folderish suggestions (#105) #106: Suggest: do not embed the child listing of folderish suggestions (#105) #106 (review)Commit 2 is mirrored as a separate PR against main so the
@componentsfix makes the v2 release; this PR merges only after that one is approved and merged.Test:
test_full_serialization_omits_the_expansion_componentsadded to the serialize_brain suite from #106.