feat(ai-controllers): remove AiDigestController - #10089
Open
zone-live wants to merge 3 commits into
Open
Conversation
Clients construct AiDigestService and own digest freshness; empty-id validation moves onto the service.
Reorder Unreleased sections and use ([#10089]) PR link syntax expected by auto-changelog.
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.
Explanation
AiDigestControllerwas leftover Engine glue after digest freshness moved to React Query: empty state, empty-id checks, and a passthrough toAiDigestService.This PR deletes the controller and related messenger/state exports.
AiDigestServiceremains the fetch+validate layer (GET, 404→null, Superstruct). EmptyassetIdentifier/ front-pageidnow throw on the service instead of the controller. Clients constructAiDigestServicethemselves and own cache/freshness.References
@metamask/ai-controllersat the preview build from this PRChecklist
Note
Medium Risk
Breaking public API removal requires consumer migrations off messenger/controller wiring; service behavior change for empty IDs is minor but callers that relied on the controller layer must update.
Overview
BREAKING: Removes
AiDigestControllerand all messenger/state/controller exports from@metamask/ai-controllers. Digest HTTP fetch and Superstruct validation stay onAiDigestService; callers instantiate the service directly and own caching/freshness (e.g. React Query).Empty-input validation moves from the deleted controller into
AiDigestService:searchDigest('')andfetchFrontPageItem('')now throw using the existingAiDigestControllerErrorMessageconstants without hitting the API. Controller tests and messenger codegen scripts are removed; the package drops@metamask/base-controllerand@metamask/messengerdependencies and README diagram edges for those links.Reviewed by Cursor Bugbot for commit 1786abe. Bugbot is set up for automated code reviews on this repo. Configure here.