[Inference] Align getForFeature with useLoadConnectors logic#264166
Merged
saikatsarkar056 merged 3 commits intoelastic:mainfrom Apr 21, 2026
Merged
Conversation
…getForFeature Adds `getForFeatureWithDefault`, which wraps `getForFeature` and applies the global default AI connector configured via advanced settings (`genAiSettings:defaultAIConnector` and `genAiSettings:defaultAIConnector:defaultOnly`): - When `defaultOnly` is set, only the default connector is returned (or an empty list if the default is missing, unset, or set to the `NO_DEFAULT_CONNECTOR` sentinel). - When the feature has no admin SO override, the default connector is prepended to the resolved endpoints and deduplicated. - When an SO override exists for the feature, the default is ignored so admin intent wins. The plugin's `endpoints.getForFeature` contract now routes through this new helper so downstream callers transparently pick up the configured default. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
ApprovabilityVerdict: Needs human review This PR introduces new runtime behavior by propagating UI settings for default AI connector to the inference endpoint resolution logic. The new You can customize Macroscope's approvability policy. Learn more. |
Contributor
💚 Build Succeeded
Metrics [docs]
|
Contributor
|
@elasticmachine merge upstream |
saikatsarkar056
approved these changes
Apr 21, 2026
Contributor
|
Starting backport for target branches: 9.4 https://github.com/elastic/kibana/actions/runs/24724893305 |
Contributor
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
kibanamachine
added a commit
that referenced
this pull request
Apr 21, 2026
…264166) (#264707) # Backport This will backport the following commits from `main` to `9.4`: - [[Inference] Align getForFeature with useLoadConnectors logic (#264166)](#264166) <!--- Backport version: 9.6.6 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sorenlouv/backport) <!--BACKPORT [{"author":{"name":"Sander Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2026-04-21T13:24:46Z","message":"[Inference] Align getForFeature with useLoadConnectors logic (#264166)\n\n## Summary\n\nThis applies the correct behave to the getForFeature function, which was\nnot yet doing this.\n\n- When `defaultOnly` is set, only the default connector is returned (or\nan empty list if the default is missing, unset, or set to the\n`NO_DEFAULT_CONNECTOR` sentinel).\n- When the feature has no admin SO override, the default connector is\nprepended to the resolved endpoints and deduplicated.\n- When an SO override exists for the feature, the default is ignored so\nadmin intent wins.\n\n---------\n\nCo-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"90e9aae3e347b7286dd61c05fe2fc14a3fdfbe28","branchLabelMapping":{"^v9.5.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Search","backport:version","v9.4.0","v9.5.0"],"title":"[Inference] Align getForFeature with useLoadConnectors logic","number":264166,"url":"https://github.com/elastic/kibana/pull/264166","mergeCommit":{"message":"[Inference] Align getForFeature with useLoadConnectors logic (#264166)\n\n## Summary\n\nThis applies the correct behave to the getForFeature function, which was\nnot yet doing this.\n\n- When `defaultOnly` is set, only the default connector is returned (or\nan empty list if the default is missing, unset, or set to the\n`NO_DEFAULT_CONNECTOR` sentinel).\n- When the feature has no admin SO override, the default connector is\nprepended to the resolved endpoints and deduplicated.\n- When an SO override exists for the feature, the default is ignored so\nadmin intent wins.\n\n---------\n\nCo-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"90e9aae3e347b7286dd61c05fe2fc14a3fdfbe28"}},"sourceBranch":"main","suggestedTargetBranches":["9.4"],"targetPullRequestStates":[{"branch":"9.4","label":"v9.4.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v9.5.0","branchLabelMappingKey":"^v9.5.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/264166","number":264166,"mergeCommit":{"message":"[Inference] Align getForFeature with useLoadConnectors logic (#264166)\n\n## Summary\n\nThis applies the correct behave to the getForFeature function, which was\nnot yet doing this.\n\n- When `defaultOnly` is set, only the default connector is returned (or\nan empty list if the default is missing, unset, or set to the\n`NO_DEFAULT_CONNECTOR` sentinel).\n- When the feature has no admin SO override, the default connector is\nprepended to the resolved endpoints and deduplicated.\n- When an SO override exists for the feature, the default is ignored so\nadmin intent wins.\n\n---------\n\nCo-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"90e9aae3e347b7286dd61c05fe2fc14a3fdfbe28"}}]}] BACKPORT--> Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
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.
Summary
This applies the correct behave to the getForFeature function, which was not yet doing this.
defaultOnlyis set, only the default connector is returned (or an empty list if the default is missing, unset, or set to theNO_DEFAULT_CONNECTORsentinel).