Skip to content

Plugin system: safe deletion#259038

Merged
ppisljar merged 12 commits intoelastic:mainfrom
ppisljar:agentbuilder/plugins_3
Mar 31, 2026
Merged

Plugin system: safe deletion#259038
ppisljar merged 12 commits intoelastic:mainfrom
ppisljar:agentbuilder/plugins_3

Conversation

@ppisljar
Copy link
Copy Markdown
Contributor

@ppisljar ppisljar added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting v9.4.0 Team:agent-builder labels Mar 23, 2026
@ppisljar ppisljar force-pushed the agentbuilder/plugins_3 branch from fa5395f to f2accfc Compare March 26, 2026 08:58
@ppisljar ppisljar force-pushed the agentbuilder/plugins_3 branch from f2accfc to c41febd Compare March 26, 2026 08:59
@ppisljar ppisljar marked this pull request as ready for review March 26, 2026 11:05
@ppisljar ppisljar requested review from a team as code owners March 26, 2026 11:05
Comment on lines +27 to +44
function getSkillIdsFromSource(source: AgentProperties): string[] {
return source.configuration?.skill_ids ?? source.config?.skill_ids ?? [];
}

function referencesSkillIds(skillIds: string[], skillIdSet: Set<string>): boolean {
return skillIds.some((id) => skillIdSet.has(id));
}

function toAgentRef(source: AgentProperties, fallbackId: string): AgentRef {
const id = String(source.id ?? fallbackId);
const name = source.name;
return { id, name };
}

function removeSkillIdsFromAgent(currentSkillIds: string[], skillIdsToRemove: string[]): string[] {
const removeSet = new Set(skillIdsToRemove);
return currentSkillIds.filter((id) => !removeSet.has(id));
}
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.

How does this work? When we expose a plugin to an agent, the pluginId should be in the plugin_ids field of the agent configuration, right? So we should be checking for all the agents that reference this plugin id in that field?

I'm confused that we're checking for individual skill ids in the agent.configuration 🤔 I don't think skills that are bundled as part of plugins should ever be included in the agent.configuration.skill_ids

Maybe I'm reading this all wrong, let me know 😄

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.

Example: none of the skill-ids for this financial-analysis plugin are included in the agent.configuration.skill_ids

image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

claude had the same opinion, but i was able to convince it otherwise 🥹

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #194 / Cloud Security Posture GET /internal/cloud_security_posture/stats KSPM Compliance Dashboard Stats API should return KSPM clusters V1
  • [job] [logs] FTR Configs #93 / discover/esql_4 discover esql controls when unlinking a ES|QL panel with controls and explorting it in discover should retain the controls and their state

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
agentBuilder 1415 1416 +1

Async chunks

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

id before after diff
agentBuilder 664.6KB 667.0KB +2.4KB

Page load bundle

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

id before after diff
agentBuilder 94.1KB 94.1KB +32.0B

History

Copy link
Copy Markdown
Contributor

@chrisbmar chrisbmar left a comment

Choose a reason for hiding this comment

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

FE changes LGTM, reviewed the ES updates too and they look good - test coverage explains it well, might want to double-check with Pierre tho if you're in doubt.

mutationFn: ({ pluginId, force }) => pluginsService.delete({ pluginId, force }),
onSettled: () => {
queryClient.invalidateQueries({ queryKey: queryKeys.plugins.all });
queryClient.invalidateQueries({ queryKey: queryKeys.skills.all });
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.

Not sure we need to do this as skills shouldn't be affected

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

plugins bundle skills, so i think we need to do this after we remove them.

Copy link
Copy Markdown
Member

@florent-leborgne florent-leborgne left a comment

Choose a reason for hiding this comment

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

LGTM for docs and copy

@ppisljar ppisljar merged commit 201ea67 into elastic:main Mar 31, 2026
18 checks passed
mbondyra added a commit to mbondyra/kibana that referenced this pull request Mar 31, 2026
…e_for_children6

* commit '3402744f63ca1196e97b11ffac4e7f7efab240df': (80 commits)
  [PerUserAuth] Add EARS auth type for Connectors V2 (elastic#253695)
  Fix `@elastic/eui/require-aria-label-for-modals` lint violations across `@elastic/kibana-core` files (elastic#259757)
  [Entity Analytics][Leads generation][4] Add API routes, LeadDataClient, and async generation (elastic#257046)
  [Agent Builder] Agent-centric UX redesign (elastic#258005)
  fix query streams failing test (elastic#260277)
  [Lens as code] Add list layout to the new API (elastic#259967)
  [FTR] Add warning comments to deployment-agnostic FTR base configs (elastic#260018)
  [Discover][Logs profile] Fix missing search highlights (elastic#260056)
  Plugin system: safe deletion (elastic#259038)
  [Infra] Fix Hosts filter options to match selected schema (elastic#259825)
  Manual Entity Resolution and flyout representation (elastic#260162)
  [Cascade] Handle grouping on fields with unset values (elastic#260033)
  [Fleet] generate OTel config for integration packages with otelcol inputs (elastic#259968)
  [Search] Switch over to V2 index management details (elastic#259866)
  [inference] increase timeout for ES inference calls (elastic#260382)
  [ES|QL] Enable subqueries (elastic#257455)
  [ES|QL] Change Point order free options (elastic#260282)
  [Auth] Added authentication strategy for UIAM OAuth (elastic#256182)
  [Security Solution] Add "alerts_candidate_count" rule execution metric (elastic#259917)
  [api-docs] 2026-03-31 Daily api_docs build (elastic#260380)
  ...
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
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:agent-builder v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants