Skip to content

[9.4] [Inference] Make feature settings reading work for users without inference privileges (#290457) - #290625

Merged
sphilipse merged 6 commits into
elastic:9.4from
sphilipse:backport/9.4/pr-290457
Sep 15, 2026
Merged

sphilipse merged 6 commits into
elastic:9.4from
sphilipse:backport/9.4/pr-290457

Conversation

@sphilipse

Copy link
Copy Markdown
Member

Backport

This will backport the following commits from main to 9.4:

Questions ?

Please refer to the Backport tool documentation

…rence privileges (elastic#290457)

Without the searchInferenceEndpoints.read privilege, users using an LLM
feature were presented with the full list of LLMs instead of only the
list of LLMs allowed for that feature. Fixing that by using the internal
user to read the settings.

### Checklist

Check the PR satisfies following conditions.

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/docs/extend/kibana/contributing/workflow/how-we-use-github#release-notes)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 0fa2625)

# Conflicts:
#	x-pack/platform/plugins/shared/search_inference_endpoints/server/plugin.ts
@sphilipse sphilipse added the backport This PR is a backport of another PR label Sep 11, 2026
@sphilipse
sphilipse enabled auto-merge (squash) September 11, 2026 15:47
@kibanamachine
kibanamachine requested review from saikatsarkar056 and removed request for kibanamachine September 11, 2026 15:47

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed this backport of #290457. One concrete issue: the start-contract getForFeature ended up with a duplicated const getConnectorById declaration in the same block scope, which is a redeclaration error and breaks the build. Note: the inline suggestion block on that line is not quite right — the correct fix is simply to delete the newly added duplicate line (the prose in the comment describes this). The rest of the backport (using getUnsafeInternalClient scoped to the request namespace, plus tests) matches the source PR and looks sound.

Generated by Claude Reviewer for #290625 · claude · opus · 105.4 AIC · ⌖ 22.9 AIC · ⊞ 5.5K

request: KibanaRequest
) => {
const soClient = getInferenceSettingsClient(core.savedObjects, request);
const getConnectorById = (id: string) => plugins.inference.getConnectorById(id, request);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This backport introduces a duplicate const getConnectorById declaration. A few lines below (before resolveFeatureEndpoints) the same const getConnectorById = (id: string) => plugins.inference.getConnectorById(id, request); already exists in this block scope. Two const declarations of the same name in the same block is a redeclaration error (TS2451 "Cannot redeclare block-scoped variable 'getConnectorById'"), which breaks the build. The backport didn't apply cleanly here — the line should be removed since the existing declaration below covers it.

Suggested change
const getConnectorById = (id: string) => plugins.inference.getConnectorById(id, request);
const soClient = getInferenceSettingsClient(core.savedObjects, request);

sphilipse and others added 4 commits September 14, 2026 15:10
The cherry-pick introduced a redundant `const getConnectorById` line
immediately after `soClient`, duplicating the identical declaration
that already exists after `uiSettingsClient` in the same block scope.
Remove the extra declaration to resolve the TS2451 redeclaration error.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

✅ unchanged

Test Failures

  • [job] [logs] Jest Tests #7 / AvailableStat component displays the tooltip with the correct content
  • [job] [logs] Scout Lane #11 - stateful-classic / default / local-stateful-classic - Attachments - adds and removes all attachments from the stream

History

@sphilipse
sphilipse merged commit 81d3d9e into elastic:9.4 Sep 15, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants