Skip to content

feat(ai-controllers): remove AiDigestController - #10089

Open
zone-live wants to merge 3 commits into
mainfrom
feat/remove-ai-digest-controller
Open

feat(ai-controllers): remove AiDigestController#10089
zone-live wants to merge 3 commits into
mainfrom
feat/remove-ai-digest-controller

Conversation

@zone-live

@zone-live zone-live commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Explanation

AiDigestController was leftover Engine glue after digest freshness moved to React Query: empty state, empty-id checks, and a passthrough to AiDigestService.

This PR deletes the controller and related messenger/state exports. AiDigestService remains the fetch+validate layer (GET, 404→null, Superstruct). Empty assetIdentifier / front-page id now throw on the service instead of the controller. Clients construct AiDigestService themselves and own cache/freshness.

References

  • TSA-1059
  • Follows #10020 (controller became a cache-free passthrough)
  • Mobile consumer PR will follow so you can point @metamask/ai-controllers at the preview build from this PR

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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 AiDigestController and all messenger/state/controller exports from @metamask/ai-controllers. Digest HTTP fetch and Superstruct validation stay on AiDigestService; callers instantiate the service directly and own caching/freshness (e.g. React Query).

Empty-input validation moves from the deleted controller into AiDigestService: searchDigest('') and fetchFrontPageItem('') now throw using the existing AiDigestControllerErrorMessage constants without hitting the API. Controller tests and messenger codegen scripts are removed; the package drops @metamask/base-controller and @metamask/messenger dependencies 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.

Clients construct AiDigestService and own digest freshness; empty-id validation moves onto the service.
@zone-live
zone-live requested review from a team as code owners September 3, 2026 13:10
@zone-live
zone-live deployed to default-branch September 3, 2026 13:10 — with GitHub Actions Active
Reorder Unreleased sections and use ([#10089]) PR link syntax expected by auto-changelog.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant