Refactor the ActiveContext::Query::Result class
What does this MR do and why?
This refactors the Ai::ActiveContext::Queries::Result class based on the suggestions from non-blocking reviews in SemanticCodeSearch: Handle scenario where proje... (!208905 - merged)
- added helper class methods
.success,.error, and.no_embeddings_error - added an
#error_messagemethod, levering a "template" to build the relevant error message from given target - removed the inheritance from
SimpleDelegator, and manually delegate certain array methods tohitsinstead- see !210237 (comment 2846134867) for reason why
References
Related issue: Refactor the ActiveContext Query Result class (#577760 - closed)
Screenshots or screen recordings
How to set up and validate locally
This is a refactor so there is no need for a very involved local validation. But to test this, you can:
-
Setup MCP server on your GDK
-
Enable the
code_snippet_search_graphqlapiFeature Flag -
With your preferred MCP client (you can use MCP Inspector):
- test the
semantic_code_searchtool against a project with code embeddings - test the
semantic_code_searchtool against a project without code embeddings
Note: see screenshots above for the expected results of either test
- test the
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #577760 (closed)


