diff --git a/Makefile.custom.mk b/Makefile.custom.mk index 00a88fefa..9cdbfe86f 100644 --- a/Makefile.custom.mk +++ b/Makefile.custom.mk @@ -2630,7 +2630,7 @@ verify-identity: ## Assert the kagent-flux tenant identity (ONE value: ServiceAc @$(HELM) template t $(CHART_DIR) -f $(CHART_DIR)/ci/ci-values.yaml --set agent-manager.muster.url=http://muster.default.svc.cluster.local:8090/mcp >/dev/null 2>&1 || { echo "FAIL: an agreeing agent-manager.muster.url must pass"; exit 1; } @grep -q 'define "agent-platform.musterMcpUrl"' $(CONNECTIVITY_DIR)/templates/_helpers.tpl || { echo "FAIL: the connectivity chart lost the agent-platform.musterMcpUrl helper"; exit 1; } @grep -q 'define "agent-platform.musterMcpUrl"' $(CHART_DIR)/templates/_helpers.tpl || { echo "FAIL: the meta chart lost the agent-platform.musterMcpUrl helper"; exit 1; } - @$(HELM) template t $(CHART_DIR) -f $(CHART_DIR)/ci/ci-values.yaml --set components.muster.enabled=false 2>/dev/null | awk '/^kind: HelmRelease$$/{h=1} h&&/^ name: agent-manager$$/{f=1} f&&/^---/{exit} f' >$(VERIFY_TMP)/vid-meta-am-nomuster.out; if grep -q 'url: http://' $(VERIFY_TMP)/vid-meta-am-nomuster.out; then echo "FAIL: agent-manager's muster.url is derived while the muster component is off"; exit 1; fi + @$(HELM) template t $(CHART_DIR) -f $(CHART_DIR)/ci/ci-values.yaml --set components.muster.enabled=false 2>/dev/null | awk '/^kind: HelmRelease$$/{h=1} h&&/^ name: agent-manager$$/{f=1} f&&/^---/{exit} f' >$(VERIFY_TMP)/vid-meta-am-nomuster.out; if grep -qE 'url: http://[^ ]+/mcp$$' $(VERIFY_TMP)/vid-meta-am-nomuster.out; then echo "FAIL: agent-manager's muster.url is derived while the muster component is off"; exit 1; fi @echo "ok: muster MCP URL — one helper, one consumer (agent-manager muster.url; the portal sends none)" @echo "--> empty value: no identity, agent-manager omits the ServiceAccount" @$(HELM) template t $(CONNECTIVITY_DIR) $(IDENTITY_ON) --set kagent.fluxServiceAccountName= >$(VERIFY_TMP)/vid-empty.out 2>&1 || { cat $(VERIFY_TMP)/vid-empty.out; exit 1; } diff --git a/UPGRADE.md b/UPGRADE.md index 5deae320d..5f2d6f54e 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -15,6 +15,18 @@ Every component ships its own CRDs and upgrades them with its release; there is A CRD version change that needs more than an apply (a stored version dropped, as with kagent's `v1alpha2`) has its own entry below, with the hook that does it. +## \ → \ (agent-manager 2.24: `list_organizations` and write-only organization credentials) + +giantswarm/backstage#3364: `components.agent-manager.versionRange` is `>=2.24.0 <3.0.0`. agent-manager 2.24.0 replaces the tool `list_my_organizations` with `list_organizations` (the organizations the person manages or belongs to), makes organization credentials write-only (it writes them without reading the Secret as the caller), adds `replace_organization_credential`, and answers a save whose credential's consumers changed with `credential_consumers_changed`; the Dev Portal 3.38.0 replaces a credential with `replace_organization_credential` and deletes one through its delete dialog (it lists organizations with `list_organizations` from 3.37.0, giantswarm/backstage#3467). 2.24.0 is also `agent-platform.agentManager.skillManagerFloor`: with `components.skill-manager` on (it follows agent-manager), agent-manager now pins skills through the skill-manager (`skillManager.url`) and gets `installation` and, while the default agent is on, `defaultAgentModel`, as the earlier entry on the default agent and the skill-manager describes. With `defaultAgentModel`, agent-manager gives the default agent (`default-agent` in the kagent namespace) the installation's default model once, while it has none: the ModelConfig in the kagent namespace annotated `agent-platform.giantswarm.io/is-default-model-config: "true"`. Below this floor the default agent gets no model and is not ready (`Compatible=False`, `kagent ModelConfig is required`). The agent-manager migrate run's image (`agentManager.migration.image.tag`) is already `2.24.0`, so the migrate run pins skills the same way. The range stays below 3.0.0: admitting agent-manager 3.x is a separate step. + +### Operator action + +- **A client or agent that calls `list_my_organizations`**: call `list_organizations`. The platform's `agent-platform-organizations` skill names the new tool. +- **A Dev Portal before 3.37.0** (`components.backstage` pinned below it, or a portal installed apart): it still calls `list_my_organizations`, so its organization list fails. Move it to 3.37.0 or later; 3.38.0 or later to replace and delete credentials. +- **An installation that sets `agent-manager.skills.repositories`**: the render fails while the skill-manager is on. **Before the upgrade**, move the list to `skillManager.sources`, or set `components.skill-manager.enabled: false`. +- **The default agent's model**: annotate one ModelConfig in the kagent namespace with `agent-platform.giantswarm.io/is-default-model-config: "true"`, or set `defaultAgent.modelConfig`, or set `components.default-agent.enabled: false`. Without one of these the default agent stays without a model and is not ready. +- **An installation that pins the BOM**: move `agent-manager` to `2.24.0`. + ## \ → \ (the default agent, the skill-manager and `skillManager.sources`) giantswarm/giantswarm#38970, giantswarm/giantswarm#38322: the chart deploys the default agent (`default-agent` in the kagent namespace) wherever kagent, muster and agent-manager are on, and the skill-manager (`components.skill-manager`) wherever agent-manager is on. The skill-manager and the portal take their skill sources from `skillManager.sources`, with the platform's own `skills/` first. agent-manager pins skills through the skill-manager (`skillManager.url`) from `agent-platform.agentManager.skillManagerFloor` on. Platform HelmReleases are named after their `components` key, which is the chart name for every existing component, so no release is renamed. diff --git a/docs/organization-credentials.md b/docs/organization-credentials.md index 18c9f7904..abba2254d 100644 --- a/docs/organization-credentials.md +++ b/docs/organization-credentials.md @@ -8,7 +8,7 @@ Set `agent-manager.credentials.uiURL` to the HTTPS URL template of the client th The form uses its client's authenticated backend path to post the value to agent-manager's REST API as the person; agent-manager exposes no browser CORS exception. A client backend outside the cluster reaches that API through `agentManager.route` (`https://agentgateway./agent-manager`, `agentManager.route.hostname` overrides the host): turn on `agentManager.route.enabled`, and `agentManager.route.jwtAuthentication.enabled` with the identity provider's issuer. agent-manager validates the token itself (`agent-manager.oauth`), so the audience of the ID token the client sends must be one it trusts (`agent-manager.oauth.trustedAudiences` and the muster audiences it accepts). -Credential operations and `agent-manager.githubTokenExchange` need a floor of `2.22.0` or later in `components.agent-manager.versionRange`, the default. The organization switch keeps its own `2.20.0` floor. muster reaches the elicitation to the client from `5.61.0` (giantswarm/muster#1812), the floor of `components.muster.versionRange`. +Credential operations and `agent-manager.githubTokenExchange` need a floor of `2.22.0` or later in `components.agent-manager.versionRange`. The default floor, `2.24.0`, makes credentials write-only (agent-manager writes them without reading the Secret as the caller): `replace_organization_credential` replaces one, and a save whose credential's consumers changed is answered `credential_consumers_changed`. The Dev Portal's credential form needs it ([giantswarm/backstage#3364](https://github.com/giantswarm/backstage/issues/3364)). The organization switch keeps its own `2.20.0` floor. muster reaches the elicitation to the client from `5.61.0` (giantswarm/muster#1812), the floor of `components.muster.versionRange`. `agent-manager.credentials.uiURL` needs `agentPlatformOrganizations.enabled`: agent-manager serves the form link only with its organization tools and downstream OAuth on. diff --git a/helm/agent-platform/README.md b/helm/agent-platform/README.md index 977ffaeb2..51ff253ac 100644 --- a/helm/agent-platform/README.md +++ b/helm/agent-platform/README.md @@ -565,7 +565,7 @@ The map is merged into each component's own `nodeSelector` (`muster.nodeSelector | components.model-manager.dependsOn[2] | string | `"kserve-llmisvc-resources"` | | | components.agent-manager.chart | string | `"agent-manager"` | | | components.agent-manager.repository | string | `"oci://gsoci.azurecr.io/charts/giantswarm"` | | -| components.agent-manager.versionRange | string | `">=2.22.0 <3.0.0"` | | +| components.agent-manager.versionRange | string | `">=2.24.0 <3.0.0"` | | | components.agent-manager.valuesFrom | string | `"agent-manager"` | | | components.agent-manager.omitEmptyKeys[0] | string | `"harness.egress"` | | | components.agent-manager.enabled | bool | `false` | | diff --git a/helm/agent-platform/examples/customer-bom.yaml b/helm/agent-platform/examples/customer-bom.yaml index d8f90cb00..fdf8021c3 100644 --- a/helm/agent-platform/examples/customer-bom.yaml +++ b/helm/agent-platform/examples/customer-bom.yaml @@ -50,7 +50,7 @@ components: agent-sandbox: { versionRange: "0.2.31" } dicebear: { versionRange: "0.3.10" } model-manager: { versionRange: "1.14.0" } - agent-manager: { versionRange: "2.22.0" } + agent-manager: { versionRange: "2.24.0" } # The default agent (components.default-agent): the agent chart. default-agent: { versionRange: "2.6.0" } vm-manager: { versionRange: "0.24.0" } diff --git a/helm/agent-platform/templates/_helpers.tpl b/helm/agent-platform/templates/_helpers.tpl index 6a7fdd861..92666407e 100644 --- a/helm/agent-platform/templates/_helpers.tpl +++ b/helm/agent-platform/templates/_helpers.tpl @@ -4678,14 +4678,14 @@ the define. {{- define "agent-platform.backstage.skillSourcesFloor" -}}3.31.0{{- end -}} {{/* -PLACEHOLDER (giantswarm/giantswarm#38322): the first agent-manager release -that takes skillManager.url and pins skills through the skill-manager, and -takes installation and defaultAgentModel (giantswarm/agent-manager#290); an -earlier release's closed values schema refuses the keys. A release candidate -of it counts (componentFloorAtLeast), so a range floor below the candidate -that carries #290 (2.24.0-rc.6 and earlier) gets keys it refuses. Set it to -that release before raising components.agent-manager.versionRange to it. One -line, no comment inside the define. +The first agent-manager release that takes skillManager.url and pins skills +through the skill-manager, and takes installation and defaultAgentModel +(giantswarm/agent-manager#290, giantswarm/giantswarm#38322); an earlier +release's closed values schema refuses the keys. A release candidate of it +counts (componentFloorAtLeast), so a range floor below the candidate that +carries #290 (2.24.0-rc.6 and earlier) gets keys it refuses. The default +floor of components.agent-manager.versionRange is this release. One line, no +comment inside the define. */}} {{- define "agent-platform.agentManager.skillManagerFloor" -}}2.24.0{{- end -}} diff --git a/helm/agent-platform/values.yaml b/helm/agent-platform/values.yaml index 277dc59cd..52907a8e2 100644 --- a/helm/agent-platform/values.yaml +++ b/helm/agent-platform/values.yaml @@ -1157,7 +1157,16 @@ components: # @schema additionalProperties: true # agent-manager.githubTokenExchange need: it answers a missing organization # credential with the credentials.uiURL form and exchanges the person's # identity for their GitHub App grant. - versionRange: ">=2.22.0 <3.0.0" + # 2.24.0 is the floor the Dev Portal's organization pages need + # (giantswarm/backstage#3364): list_organizations replaces + # list_my_organizations, organization credentials are write-only, + # replace_organization_credential replaces one, and a save whose + # credential's consumers changed is answered credential_consumers_changed + # (giantswarm/agent-manager#360, #361, #364, #373). It is also + # agent-platform.agentManager.skillManagerFloor: from it agent-manager pins + # skills through the skill-manager and takes installation and + # defaultAgentModel (giantswarm/agent-manager#290). + versionRange: ">=2.24.0 <3.0.0" valuesFrom: agent-manager # harness.egress travels only when set: the key is new in agent-manager # 1.11.0, and an older chart's closed harness block refuses it; unset, the diff --git a/skills/agent-platform-organizations/SKILL.md b/skills/agent-platform-organizations/SKILL.md index a71c0cb3f..1419c683c 100644 --- a/skills/agent-platform-organizations/SKILL.md +++ b/skills/agent-platform-organizations/SKILL.md @@ -9,7 +9,7 @@ metadata: Kubernetes RBAC decides everything here; the portal and Slack only show the result. Read the live answer, never guess: `x_agent-manager_list_agents` and `x_agent-manager_get_agent` name each -agent's namespace, `x_agent-manager_list_my_organizations` the organizations the person belongs to. +agent's namespace, `x_agent-manager_list_organizations` the organizations the person manages or belongs to. Access set-up: https://docs.giantswarm.io/tutorials/agent-platform/access-control/. ## Owners diff --git a/tests/golden/meta-ci-engine-off.yaml b/tests/golden/meta-ci-engine-off.yaml index 415d42ce8..aadcd1736 100644 --- a/tests/golden/meta-ci-engine-off.yaml +++ b/tests/golden/meta-ci-engine-off.yaml @@ -35,6 +35,8 @@ spec: agentChart: ociUrl: oci://gsoci.azurecr.io/charts/giantswarm/agent semver: '>=2.6.0 <3.0.0' + defaultAgentModel: + agent: default-agent flux: helmReleaseServiceAccount: kagent-flux fullnameOverride: agent-manager @@ -60,6 +62,7 @@ spec: protocol: grpc tenant: giantswarm registry: gsoci.azurecr.io + installation: agent-platform kagent: apiVersion: v1alpha3 controllerTarget: "" @@ -96,9 +99,10 @@ spec: interval: 60s labels: observability.giantswarm.io/tenant: giantswarm + skillManager: + url: http://skill-manager.default.svc.cluster.local:8080 skills: - repositories: - - https://github.com/giantswarm/agent-skills + repositories: [] tenants: enabled: false --- @@ -229,6 +233,10 @@ spec: name: giantswarm-default namespace: envoy-gateway-system pathPrefix: /agent-manager + skillManager: + namespace: default + serviceTokenSecret: skill-manager-service-token + url: http://skill-manager.default.svc.cluster.local:8080 agentPlatformOrganizations: apiHostnames: [] enabled: false @@ -2730,7 +2738,8 @@ spec: - dex-k8s-authenticator enabled: true networkPolicy: - ingressNamespaces: [] + ingressNamespaces: + - kagent oauth: dex: allowPrivateURLs: true @@ -2742,6 +2751,8 @@ spec: endpoint: http://otlp-gateway.kube-system.svc:4317 headers: X-Scope-OrgID=giantswarm protocol: grpc + serviceToken: + secretName: skill-manager-service-token sources: - path: skills readOnly: true @@ -3125,7 +3136,7 @@ spec: mediaType: application/vnd.cncf.helm.chart.content.v1.tar+gzip operation: copy ref: - semver: ">=2.22.0 <3.0.0" + semver: ">=2.24.0 <3.0.0" --- # Source: agent-platform/templates/components.yaml apiVersion: source.toolkit.fluxcd.io/v1 diff --git a/tests/verify-default-agent.py b/tests/verify-default-agent.py index 13be2c926..bb8ded3ba 100755 --- a/tests/verify-default-agent.py +++ b/tests/verify-default-agent.py @@ -83,6 +83,8 @@ FLOORS = ["--set", "components.agent-manager.versionRange=>=2.99.0 <3.0.0", "--set", "components.backstage.versionRange=>=3.99.0 <4.0.0"] # Below agent-platform.backstage.skillManagerFloor: the portal still gets its own list. LIST_FLOORS = ["--set", "components.agent-manager.versionRange=>=2.99.0 <3.0.0", "--set", "components.backstage.versionRange=>=3.31.0 <3.36.0"] +# Below agent-platform.agentManager.skillManagerFloor, which the default range's floor now is. +BELOW = ["--set", "components.agent-manager.versionRange=>=2.23.0 <3.0.0"] SM_OFF = ["--set", "components.skill-manager.enabled=false"] SM_URL = "http://skill-manager.agent-platform.svc.cluster.local:8080" PORTAL = ["--set", "components.backstage.enabled=true"] @@ -208,7 +210,8 @@ def package(tmp: str, version: str, stamp: bool) -> str: if v.get("labels") != {**LABEL, "team": "x"}: fail(f"{NAME}: components.{NAME}.labels drop or change managed-by/default on the Agent, or add nothing: {v.get('labels')!r}") # agent-manager fills the default agent's empty model once, from the release that takes the key. -for what, args, want in (("below the floor", [*ON], None), ("from the floor", [*ON, *FLOORS], {"agent": NAME}), +for what, args, want in (("below the floor", [*ON, *BELOW], None), ("the default floor", [*ON], {"agent": NAME}), + ("from the floor", [*ON, *FLOORS], {"agent": NAME}), ("the default agent off", [*ON, *FLOORS, "--set", f"components.{NAME}.enabled=false"], None)): got = find(render(META, *args), "HelmRelease", "agent-manager")["spec"]["values"].get("defaultAgentModel") if got != want: @@ -218,7 +221,8 @@ def package(tmp: str, version: str, stamp: bool) -> str: fail(f"{NAME}: defaultAgent.displayName/description are not its agent.displayName/description and the system message's name: {v['agent']!r}") refused(META, "displayName", *ON, "--set", "defaultAgent.displayName=") # agent-manager reports the portal's installation name (get_info installation) from its floor on. -for what, args, want in (("below the floor", [*ON], None), ("from the floor", [*ON, *FLOORS], "agent-platform"), +for what, args, want in (("below the floor", [*ON, *BELOW], None), ("the default floor", [*ON], "agent-platform"), + ("from the floor", [*ON, *FLOORS], "agent-platform"), ("backstage.installationName=lab", [*ON, *FLOORS, "--set", "backstage.installationName=lab"], "lab")): got = find(render(META, *args), "HelmRelease", "agent-manager")["spec"]["values"].get("installation") if got != want: @@ -378,16 +382,17 @@ def portal(docs: list[dict]) -> dict: # agent-manager: through the skill-manager from its floor on, else the deprecated URL list. objs = ["--set", "skillManager.sources[0].url=https://github.com/acme/skills", "--set", "skillManager.sources[0].ref=v1", "--set", "skillManager.sources[1].url=https://github.com/acme/skills", "--set", "skillManager.sources[1].path=x"] -for what, args in (("below agent-platform.agentManager.skillManagerFloor", [*ON, *objs]), ("the skill-manager off", [*ON, *FLOORS, *SM_OFF, *objs])): +for what, args in (("below agent-platform.agentManager.skillManagerFloor", [*ON, *BELOW, *objs]), ("the skill-manager off", [*ON, *FLOORS, *SM_OFF, *objs])): repositories, smv = am_skills(render(META, *args)) if repositories != ["https://github.com/acme/skills"] or smv is not None: fail(f"agent-manager, {what}: skills.repositories {repositories!r}, skillManager {smv!r}; want skillManager.sources as URLs, once, no platform source, no skillManager") -repositories, _ = am_skills(render(META, *ON, "--set", "agent-manager.skills.repositories[0]=https://github.com/acme/own")) +repositories, _ = am_skills(render(META, *ON, *BELOW, "--set", "agent-manager.skills.repositories[0]=https://github.com/acme/own")) if repositories != ["https://github.com/acme/own"]: fail(f"agent-manager below the floor: its deprecated list does not replace skillManager.sources: {repositories!r}") -repositories, smv = am_skills(render(META, *ON, *FLOORS)) -if repositories != [] or smv != {"url": SM_URL}: - fail(f"agent-manager at the floor: skills.repositories {repositories!r}, skillManager {smv!r}; want none and {{'url': {SM_URL!r}}}") +for what, args in (("at the default floor", [*ON]), ("above the floor", [*ON, *FLOORS])): + repositories, smv = am_skills(render(META, *args)) + if repositories != [] or smv != {"url": SM_URL}: + fail(f"agent-manager {what}: skills.repositories {repositories!r}, skillManager {smv!r}; want none and {{'url': {SM_URL!r}}}") _, smv = am_skills(render(META, *ON, *FLOORS, "--set", "skill-manager.fullnameOverride=skills", "--set", "skill-manager.service.port=9090", "--set", "components.skill-manager.targetNamespace=skills")) if smv != {"url": "http://skills.skills.svc.cluster.local:9090"}: @@ -399,7 +404,7 @@ def sm_values(docs: list[dict]) -> dict: return find(docs, "HelmRelease", "skill-manager")["spec"]["values"] -v = sm_values(render(META, *ON)) +v = sm_values(render(META, *ON, *BELOW)) if v["networkPolicy"].get("ingressNamespaces") != [] or "serviceToken" in v: fail(f"skill-manager below agent-manager's floor, all in one namespace: ingressNamespaces {v['networkPolicy'].get('ingressNamespaces')!r}, serviceToken {v.get('serviceToken')!r}; want [] and none") docs = render(META, *ON, *FLOORS, *PORTAL, "--set", "components.backstage.targetNamespace=portal", "--set", "skill-manager.networkPolicy.ingressNamespaces[0]=monitoring") diff --git a/tests/verify-target.py b/tests/verify-target.py index bb75e16a4..e04685384 100755 --- a/tests/verify-target.py +++ b/tests/verify-target.py @@ -127,18 +127,26 @@ def targeted(doc: str) -> str: release's values name for the platform's pods (the kagent controller's NetworkPolicy peers, controller.networkPolicy.from) is agent-platform too, and so is the namespace of a derived MCP backend entry - (networkPolicy.mcpBackends..namespace: the component's pods).""" - out, section, backends = [], "", -1 + (networkPolicy.mcpBackends..namespace: the component's pods) and the + skill-manager's Service that agent-manager is pointed at (skillManager.url + and, on the connectivity release, agentManager.skillManager.namespace).""" + out, section, backends, skills = [], "", -1, -1 for line in doc.split("\n"): if re.match(r"^ \S", line): section = line.strip() indent = len(line) - len(line.lstrip()) if backends >= 0 and line.strip() and indent <= backends: backends = -1 + if skills >= 0 and line.strip() and indent <= skills: + skills = -1 if re.match(r"^ +mcpBackends:$", line): backends = indent - elif backends >= 0 and re.match(r"^ +namespace: default$", line): + elif re.match(r"^ +skillManager:$", line): + skills = indent + elif (backends >= 0 or skills >= 0) and re.match(r"^ +namespace: default$", line): line = line.replace(": default", ": agent-platform") + elif skills >= 0 and re.match(r"^ +url: http://[^.]+\.default\.svc\.cluster\.local[:/]", line): + line = line.replace(".default.svc.", ".agent-platform.svc.", 1) if re.match(r"^ name: ", line) and section.startswith("name:"): line = line.replace("name: ", "name: t-", 1) elif section in ("chartRef:", "dependsOn:") and re.match(r"^ (- )?name: ", line):