Skip to content

Register Streams AI features with the Inference Feature Registry#262018

Merged
thomheymann merged 5 commits intoelastic:mainfrom
thomheymann:register-ai-with-inference-registry
Apr 9, 2026
Merged

Register Streams AI features with the Inference Feature Registry#262018
thomheymann merged 5 commits intoelastic:mainfrom
thomheymann:register-ai-with-inference-registry

Conversation

@thomheymann
Copy link
Copy Markdown
Contributor

@thomheymann thomheymann commented Apr 8, 2026

Summary

Registers Streams AI suggestion features (partitioning suggestions and processing suggestions) with the Inference Feature Registry so that connector selection is managed centrally rather than via a custom internal API.

  • Adds registerSuggestionsInferenceFeatures() that registers a parent streams feature and two child features (streams_partitioning_suggestions, streams_processing_suggestions) with the searchInferenceEndpoints plugin at setup time.
  • Exports new inference feature ID constants from @kbn/streams-schema.
  • Replaces the custom GET /internal/streams/_connectors route with the useLoadConnectors hook from @kbn/inference-connectors, passing featureId so connector selection is scoped to the registered feature.
  • Simplifies useGenAIConnectors by removing manual connector loading/filtering logic and exposing isConnectorSelectionRestricted from the registry.
  • Updates server-side suggestion routes to resolve the connector/model via the inference feature registry instead of accepting a raw connectorId.
  • Updates related tests and Scout specs.

Screenshot

Screenshot 2026-04-08 at 16 02 40

Made with Cursor

@thomheymann thomheymann added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:obs-onboarding Observability Onboarding Team v9.4.0 labels Apr 8, 2026
@thomheymann thomheymann marked this pull request as ready for review April 8, 2026 15:09
@thomheymann thomheymann requested review from a team as code owners April 8, 2026 15:09
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-onboarding-team (Team:obs-onboarding)

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 8, 2026

Approvability

Verdict: Needs human review

This PR introduces new AI feature registrations with the Inference Feature Registry, removes an API endpoint, and refactors connector fetching to use a different library with changed behavior. The author does not own any of the modified files, which are all owned by obs-onboarding-team and obs-sig-events-team. The designated code owners should review these changes.

You can customize Macroscope's approvability policy. Learn more.

@flash1293
Copy link
Copy Markdown
Contributor

This seems to work well, but I'm not sure about the changes on the server side. We are still passing the connector ID from the client to the server in all cases. So it seems like the branch where it picks the default on the server side is never actually called. Should we still do it then? Is this a preparation for some future simplification?

@thomheymann
Copy link
Copy Markdown
Contributor Author

This seems to work well, but I'm not sure about the changes on the server side. We are still passing the connector ID from the client to the server in all cases. So it seems like the branch where it picks the default on the server side is never actually called. Should we still do it then? Is this a preparation for some future simplification?

@flash1293 Yeh good point. It doesn't add much value for us currently. I think where that approach shines is for background tasks or jobs that aren't triggered via UI interaction. But we can add it when it comes to that. I'll revert for now

Address PR feedback: the server-side resolveConnectorForFeature
fallback was dead code since the client always sends a connector ID.
Align with Pattern A used by other features (AI Assistant, Elastic
Assistant, Automatic Import) where interactive routes require the
client to provide the connector ID and the inference feature registry
is used only for connector listing/discovery.

Made-with: Cursor
The Streams routes use the chat completion API under the hood, so
chat_completion is the accurate task type. The previous completion
value was cosmetic-only but misleading on the Model Settings page.

Made-with: Cursor
@thomheymann thomheymann enabled auto-merge (squash) April 9, 2026 09:22
@thomheymann thomheymann merged commit 7de4899 into elastic:main Apr 9, 2026
21 checks passed
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #219 / integrations For each artifact list under management When on the Event Filters entries list should be able to add a new Event Filters entry

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
streamsApp 1758 1801 +43

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
streamsApp 1.9MB 1.9MB +5.7KB
Unknown metric groups

API count

id before after diff
@kbn/streams-schema 425 428 +3

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants