Skip to content

Align Automatic Migrations connector resolution with Assistant and Agent Builder#259840

Merged
logeekal merged 4 commits intoelastic:mainfrom
logeekal:fix/connector_id_spec_change
Mar 27, 2026
Merged

Align Automatic Migrations connector resolution with Assistant and Agent Builder#259840
logeekal merged 4 commits intoelastic:mainfrom
logeekal:fix/connector_id_spec_change

Conversation

@logeekal
Copy link
Copy Markdown
Contributor

@logeekal logeekal commented Mar 26, 2026

Summary

Aligns Automatic Migrations (SIEM Migrations) with the same connector resolution scheme used by Assistant and Agent Builder.

After #258530, Automatic Migrations was still using the old connector loading path (loadAllActions from triggers-actions-ui), which returns preconfigured connector YAML keys (e.g., Anthropic-Claude-Opus-4-6) as connector IDs. This meant the connectorId passed to naturalLanguageToEsql was a model_id (old scheme) instead of the inference_id, resulting in a Saved object [action/.anthropic-claude-4.6-opus] not found error.

This PR switches Automatic Migrations to use the inference plugin's connector resolution (same as Assistant and Agent Builder), which returns inference_id-based connector IDs.

Changes

  • Frontend: Replaced useAIConnectors / loadAiConnectors with useLoadConnectors / loadConnectorsForFeature from @kbn/inference-connectors (scoped to featureId: 'siem_migrations')
  • Backend: Replaced actionsClient.get() with inferenceClient.getConnectorById() in rules and dashboards start routes
  • @kbn/inference-connectors: Extracted loadConnectorsForFeature as a reusable stateless function from useLoadConnectors

Test plan

  • Select a preconfigured inference connector in the SIEM Migrations onboarding card
  • Start a rule migration — should succeed without "saved object not found" error
  • Start a dashboard migration — same
  • Verify connector selection persists across modal reopens (via localStorage)

--
Made with Cursor

…ent Builder

Switch SIEM Migrations from the old loadAllActions connector loading path
(which returns preconfigured YAML keys as IDs) to the inference plugin's
connector resolution (which returns inference_id-based connector IDs),
fixing "Saved object not found" errors with preconfigured inference connectors.

Made-with: Cursor
@logeekal logeekal requested a review from sphilipse March 26, 2026 17:26
@logeekal logeekal added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 labels Mar 26, 2026
@logeekal logeekal marked this pull request as ready for review March 26, 2026 17:55
@logeekal logeekal requested review from a team as code owners March 26, 2026 17:55
@logeekal
Copy link
Copy Markdown
Contributor Author

Thanks @delanni for triggering the build 🦸

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Integration Tests #10 / step level timeout should have execution duration close to configured timeout value

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
agentBuilder 1416 1417 +1
automaticImport 658 659 +1
automaticImportVTwo 241 242 +1
elasticAssistant 670 671 +1
securitySolution 9289 9290 +1
workplaceAIApp 590 591 +1
total +6

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/inference-connectors 7 11 +4

Async chunks

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

id before after diff
agentBuilder 665.8KB 665.8KB -2.0B
automaticImport 1.4MB 1.4MB +1.0B
automaticImportVTwo 171.4KB 171.4KB +4.0B
securitySolution 11.4MB 11.4MB +306.0B
total +309.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
automaticImport 10.8KB 10.8KB +1.0B
Unknown metric groups

API count

id before after diff
@kbn/inference-connectors 9 14 +5

History

@logeekal logeekal merged commit 06a9839 into elastic:main Mar 27, 2026
18 checks passed
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 30, 2026
…ent Builder (elastic#259840)

## Summary

Aligns Automatic Migrations (SIEM Migrations) with the same connector
resolution scheme used by Assistant and Agent Builder.

After elastic#258530, Automatic Migrations was still using the old connector
loading path (`loadAllActions` from triggers-actions-ui), which returns
preconfigured connector YAML keys (e.g., `Anthropic-Claude-Opus-4-6`) as
connector IDs. This meant the `connectorId` passed to
[`naturalLanguageToEsql`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/common/task/util/esql_knowledge_base.ts#L24)
was a `model_id` (old scheme) instead of the `inference_id`, resulting
in a `Saved object [action/.anthropic-claude-4.6-opus] not found` error.

This PR switches Automatic Migrations to use the inference plugin's
connector resolution (same as Assistant and Agent Builder), which
returns `inference_id`-based connector IDs.

## Changes

- **Frontend:** Replaced `useAIConnectors` / `loadAiConnectors` with
`useLoadConnectors` / `loadConnectorsForFeature` from
`@kbn/inference-connectors` (scoped to `featureId: 'siem_migrations'`)
- **Backend:** Replaced `actionsClient.get()` with
`inferenceClient.getConnectorById()` in rules and dashboards start
routes
- **`@kbn/inference-connectors`:** Extracted `loadConnectorsForFeature`
as a reusable stateless function from `useLoadConnectors`

## Test plan
- [ ] Select a preconfigured inference connector in the SIEM Migrations
onboarding card
- [ ] Start a rule migration — should succeed without "saved object not
found" error
- [ ] Start a dashboard migration — same
- [ ] Verify connector selection persists across modal reopens (via
localStorage)

--
Made with Cursor

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…ent Builder (elastic#259840)

## Summary

Aligns Automatic Migrations (SIEM Migrations) with the same connector
resolution scheme used by Assistant and Agent Builder.

After elastic#258530, Automatic Migrations was still using the old connector
loading path (`loadAllActions` from triggers-actions-ui), which returns
preconfigured connector YAML keys (e.g., `Anthropic-Claude-Opus-4-6`) as
connector IDs. This meant the `connectorId` passed to
[`naturalLanguageToEsql`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/common/task/util/esql_knowledge_base.ts#L24)
was a `model_id` (old scheme) instead of the `inference_id`, resulting
in a `Saved object [action/.anthropic-claude-4.6-opus] not found` error.

This PR switches Automatic Migrations to use the inference plugin's
connector resolution (same as Assistant and Agent Builder), which
returns `inference_id`-based connector IDs.

## Changes

- **Frontend:** Replaced `useAIConnectors` / `loadAiConnectors` with
`useLoadConnectors` / `loadConnectorsForFeature` from
`@kbn/inference-connectors` (scoped to `featureId: 'siem_migrations'`)
- **Backend:** Replaced `actionsClient.get()` with
`inferenceClient.getConnectorById()` in rules and dashboards start
routes
- **`@kbn/inference-connectors`:** Extracted `loadConnectorsForFeature`
as a reusable stateless function from `useLoadConnectors`

## Test plan
- [ ] Select a preconfigured inference connector in the SIEM Migrations
onboarding card
- [ ] Start a rule migration — should succeed without "saved object not
found" error
- [ ] Start a dashboard migration — same
- [ ] Verify connector selection persists across modal reopens (via
localStorage)

--
Made with Cursor

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…ent Builder (elastic#259840)

## Summary

Aligns Automatic Migrations (SIEM Migrations) with the same connector
resolution scheme used by Assistant and Agent Builder.

After elastic#258530, Automatic Migrations was still using the old connector
loading path (`loadAllActions` from triggers-actions-ui), which returns
preconfigured connector YAML keys (e.g., `Anthropic-Claude-Opus-4-6`) as
connector IDs. This meant the `connectorId` passed to
[`naturalLanguageToEsql`](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/server/lib/siem_migrations/common/task/util/esql_knowledge_base.ts#L24)
was a `model_id` (old scheme) instead of the `inference_id`, resulting
in a `Saved object [action/.anthropic-claude-4.6-opus] not found` error.

This PR switches Automatic Migrations to use the inference plugin's
connector resolution (same as Assistant and Agent Builder), which
returns `inference_id`-based connector IDs.

## Changes

- **Frontend:** Replaced `useAIConnectors` / `loadAiConnectors` with
`useLoadConnectors` / `loadConnectorsForFeature` from
`@kbn/inference-connectors` (scoped to `featureId: 'siem_migrations'`)
- **Backend:** Replaced `actionsClient.get()` with
`inferenceClient.getConnectorById()` in rules and dashboards start
routes
- **`@kbn/inference-connectors`:** Extracted `loadConnectorsForFeature`
as a reusable stateless function from `useLoadConnectors`

## Test plan
- [ ] Select a preconfigured inference connector in the SIEM Migrations
onboarding card
- [ ] Start a rule migration — should succeed without "saved object not
found" error
- [ ] Start a dashboard migration — same
- [ ] Verify connector selection persists across modal reopens (via
localStorage)

--
Made with Cursor

---------

Co-authored-by: Alex Szabo <alex.szabo@elastic.co>
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 v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants