feat: support optional skills packages

Merged
SC
1mo ago
+534-14

What type of PR is this?

/kind api

What this PR does / why we need it:

Adds an opt-in spec.skills[].optional field to the v1alpha2 AgentConfig API.

Required packages keep the existing fail-fast behavior. An optional package logs its source and allows the remaining packages and agent startup to continue when npx skills add fails. This prevents an unavailable third-party skills package from blocking an otherwise usable agent when the caller has explicitly accepted degraded capability.

The field defaults to false, is preserved across v1alpha1 conversion through an annotation, and does not add new surface area to the compatibility API version.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

  • make verify passes.
  • make test passes.
  • make build passes after removing a Homebrew LDFLAGS value from the local environment; the Makefile forwards that variable to Go's -ldflags.
  • Script-execution tests cover optional failure with a later successful package, required fail-fast behavior, and the all-optional/all-failed case.
  • Conversion tests cover round-trip preservation and ambiguous duplicate protection.

Does this PR introduce a user-facing change?

AgentConfig v1alpha2 skills can set `optional: true` so a package installation failure is logged without blocking agent startup.

Summary by cubic

Adds spec.skills[].optional to the v1alpha2 AgentConfig API so agent startup continues when an optional skills package fails to install, while required packages keep the existing fail-fast behavior.

  • Optional package failures are logged with the package source; remaining packages and agent startup proceed, and an all-optional failure leaves an empty plugin skills directory.
  • Required packages keep failing fast on install, relocation, or install-nothing failures; secretRef validation is unchanged and still fails before Job creation. The field defaults to false and is preserved across v1alpha1 conversion via an annotation.
  • Optional is v1alpha2-only and rejected by the CLI when only v1alpha1 CRDs exist; script-execution and e2e tests cover the continuation and fail-fast paths.