Skip to content

feat: ship the General Purpose Agent (default-agent) with the chart - #1300

Closed
marians wants to merge 3 commits into
mainfrom
feat/default-agent
Closed

marians wants to merge 3 commits into
mainfrom
feat/default-agent

Conversation

@marians

@marians marians commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Towards giantswarm/giantswarm#39057 (step 1).

The chart ships exactly one agent: default-agent, shown as "General Purpose Agent". Every surface starts a session with it unless the person picks another agent.

What it does

Not in this PR

Upgrade

An installation that already has an agent named default-agent in the kagent namespace has to rename or delete it first, or turn the component off. Both releases would share the Helm release name and storage namespace and take over each other's release. The UPGRADE.md entry covers this.

Checklist

  • Update changelog in CHANGELOG.md.
  • Make sure values.yaml and values.schema.json are valid.
  • A new or materially changed serving preset states its kubernetes-cka-v2 mean score and range and links the committed result (docs/serving-presets.md). Not applicable.

Rotfuks and others added 2 commits November 6, 2026 09:30
The five agent-platform-* skills, scripts/validate_skills.py with make
verify-skills, and the rule that a platform change updates the affected
skills in the same pull request. Taken from #1265
(3e83222..2867ca6).

Towards giantswarm/giantswarm#39057
The component default-agent deploys one agent chart release into the kagent
namespace while kagent and muster are on, with toolset preset:full, the
platform skills pinned to the release commit (hack/stamp-release-commit.sh,
the tag-only stamp-release-commit job), defaultAgent.displayName and
defaultAgent.modelConfig. klaus-gateway's a2a.defaultAgent and every portal
agent role default to it; explicit values win.

The component loop takes valuesFile, labels, inKagentNamespace and
disableWait, and names releases after their components key. The skills
describe the General Purpose Agent in place of the Agent Manager, and
agent-platform-tools carries the per-session sign-in rule.

Towards giantswarm/giantswarm#39057

Co-authored-by: Dominik Schmidle <dominik@giantswarm.io>
@marians
marians requested a review from a team as a code owner November 6, 2026 08:47
@circleci-architect

circleci-architect Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Published Helm chart agent-platform-connectivity

4.175.1-r0f2d4d36t20261106091833h2cf1089
Chart agent-platform-connectivity
Version 4.175.1-r0f2d4d36t20261106091833h2cf1089
OCI reference oci://gsoci.azurecr.io/charts/giantswarm/agent-platform-connectivity:4.175.1-r0f2d4d36t20261106091833h2cf1089
Digest sha256:45096cc8ca19657e2ee24b416968d56051f11479e688ea3461231aa896f44c33
Registry public — gsoci.azurecr.io
Git catalog giantswarm-test-catalog (index)
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent-platform-connectivity --version 4.175.1-r0f2d4d36t20261106091833h2cf1089

Posted by architect-orb · build 30579 · commit 2cf1089 · updated in place on every push

@circleci-architect

circleci-architect Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Published Helm chart agent-platform

4.175.1-r0f2d4d36t20261106091833h2cf1089
Chart agent-platform
Version 4.175.1-r0f2d4d36t20261106091833h2cf1089
OCI reference oci://gsoci.azurecr.io/charts/giantswarm/agent-platform:4.175.1-r0f2d4d36t20261106091833h2cf1089
Digest sha256:a428bb44f2bf968bf037c8477ec934a4a7975615f2a07ab7b24879e6bc0c3332
Registry public — gsoci.azurecr.io
Git catalog giantswarm-test-catalog (index)
Pull this chart
helm pull oci://gsoci.azurecr.io/charts/giantswarm/agent-platform --version 4.175.1-r0f2d4d36t20261106091833h2cf1089

Posted by architect-orb · build 30580 · commit 2cf1089 · updated in place on every push

{{- /* The agent of a channel turn that names none: default-agent while it
is on. An own value wins. */ -}}
{{- if and (include "agent-platform.componentEnabled" (dict "root" .root "name" "default-agent")) (not (dig "a2a" "defaultAgent" "" $kg)) -}}
{{- $_ := set $derived "a2a" (dict "defaultAgent" "default-agent") -}}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

klaus-gateway's derived a2a.defaultAgent is the bare name default-agent, but the agent is installed into the kagent component's namespace while klaus-gateway resolves bare names in its own a2a.namespace (chart default kagent), which the meta chart never derives.

With kagent.namespaceOverride=agents, default-agent installs into agents (verify-default-agent asserts targetNamespace=agents), klaus-gateway gets a2a.defaultAgent: default-agent without an a2a.namespace and looks it up in kagent. Every Slack turn that names no agent then fails with agent not found. Derive <kagent ns>/default-agent (klaus-gateway accepts namespace/name), the same way the portal roles get <installation>/<kagent ns>/default-agent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: klaus-gateway now gets <kagent namespace>/default-agent, which it accepts as namespace/name (its a2a.defaultAgent doc: "a bare name in a2a.namespace, or namespace/name"). verify-default-agent checks kagent/default-agent and agents/default-agent with kagent.namespaceOverride=agents.

Comment thread UPGRADE.md Outdated

### Operator action

- **An installation with an Agent named `default-agent` in the kagent namespace**: Helm refuses to take over an object of another release, so the install of the platform's release fails. Remove that agent first, or set `components.default-agent.enabled: false`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The upgrade note says an existing Agent named default-agent makes the install fail, but an agent-manager agent of that name is a Flux HelmRelease in the kagent namespace whose Helm release is default-agent stored in kagent. That is the same release name and storage namespace as the new component (releaseName default-agent, storageNamespace kagent).

An installation where someone created an agent default-agent through agent-manager: helm-controller finds an existing Helm release default-agent in kagent that the platform HelmRelease has not observed, and treats it as unmanaged, so it upgrades it rather than refusing. The two HelmReleases then take turns upgrading the same release with different values, and the person's agent is overwritten. The note's remedy is not triggered, because nothing fails.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: the note now asks to rename or delete such an agent before upgrading (or to turn the component off), and says why: both releases share the Helm release name and storage namespace and would take over each other's release.

{{- with .Values.global.domain -}}{{- $host = $host | default (printf "avatars.%s" .) -}}{{- end -}}
{{- end -}}
{{- with $host -}}
{{- $_ := set $agent "iconUrl" (printf "https://%s/v1/default-agent.png" .) -}}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

agent.iconUrl is derived from the DiceBear route hostname or avatars.<global.domain> without checking whether the avatar route is rendered at all (dicebear.route.enabled, resolved from auto).

A cluster without gateway.envoyproxy.io/v1alpha1 (route auto resolves false) or with dicebear.route.enabled=false still gets iconUrl: https://avatars.<domain>/v1/default-agent.png. Nothing serves that host, so the default agent shows a broken avatar in the portal and in Slack. verify-default-agent even asserts the icon on the default (route-less) render. Gate on the resolved shape (agent-platform.shape.dicebearRoute).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: iconUrl is derived only while the avatar route renders (agent-platform.shape.dicebearRoute). The test covers auto without Envoy Gateway and an explicit dicebear.route.enabled=false.

"type": "object",
"additionalProperties": false,
"properties": {
"agent-platform.giantswarm.io/managed-by": {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The generated schema closes components.default-agent.labels (additionalProperties: false, with only the managed-by key), although components.yaml documents labels as the generic extra labels on the child HelmRelease.

--set components.default-agent.labels.team=x fails the render: at '/components/default-agent/labels': additional properties 'team' not allowed. Add # @schema additionalProperties: true (or a string map type) on the labels key in values.yaml.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: labels carries # @schema additionalProperties: true, and the test renders with an extra label on the entry.

{{- with $host -}}
{{- $_ := set $agent "iconUrl" (printf "https://%s/v1/default-agent.png" .) -}}
{{- end -}}
{{- $out := dict "muster" (dict "url" (include "agent-platform.musterMcpUrl" .)) "toolset" (list "preset:full") "labels" (dict "agent-platform.giantswarm.io/managed-by" "agent-platform") -}}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The Agent's managed-by label is hard-coded in agent-platform.defaultAgent.derived, separately from components.default-agent.labels, which only reaches the HelmRelease. The two sources of the same label can drift.

An installation or a later change edits components.default-agent.labels (for example the managed-by value agent-manager keys its read-only listing on). The HelmRelease changes but the Agent keeps the hard-coded label, so agent-manager's managed: platform classification no longer matches the component's declared labels. Derive the Agent's labels from the entry's labels.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this as is. The two labels do different jobs: the entry's labels mark the HelmRelease for the platform, while the Agent's label is what agent-manager reads for its read-only rule, and that one must not be droppable through values. Deriving it from the entry would let an installation remove the read-only marking by overriding labels.

*/}}
{{- define "agent-platform.componentValuesFile" -}}
{{- $vals := .root.Files.Get .path | fromYaml -}}
{{- if not $vals -}}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The not $vals guard misses a malformed values file. Helm's fromYaml returns {"Error": "..."} on a parse error, which is truthy.

A YAML mistake in agents/default-agent/values.yaml (bad indentation in the prompt) does not fail with "missing from the chart or empty". Instead the component gets the values {Error: ...} plus the derived keys and no prompt or skills. Then either the agent chart refuses an unknown Error key at reconcile time on every installation, or the agent ships without its prompt. Check hasKey $vals "Error" and fail.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: a values file that does not parse now fails the render with <path> does not parse: <error>. The test renders a copy with broken YAML.

{{- if hasKey $vals "skills" -}}
{{- $pinned := list -}}
{{- range $vals.skills -}}
{{- if eq (toString (dig "git" "commit" "" (ternary . dict (kindIs "map" .)))) "[[ .SHA ]]" -}}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only skills[].git.commit placeholders are dropped or guarded, but hack/stamp-release-commit.sh stamps every [[ .SHA ]] under agents/. A placeholder anywhere else (plugins[].git.commit, which the agent chart pins the same way) passes through literally.

Someone adds a plugins[] entry pinned to [[ .SHA ]]. A branch build forwards commit: "[[ .SHA ]]" to the agent chart, which refuses the non-hex commit, so the default-agent HelmRelease fails on every dev install. A release packaged without the stamp is also not caught by the published-release guard for that entry.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: after the skills are handled, a [[ .SHA ]] left anywhere else in the file fails every render, since only a skill pin can be left out on an unstamped build. The test renders a copy with a placeholder under plugins[].

disagrees with it). */ -}}
{{- $on = ($root.Values.agentPlatformOrganizations | default dict).enabled | default false }}
{{- end }}
{{- if and $on (eq .name "default-agent") }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Altitude: default-agent's gating on kagent and muster is a name special case in the shared componentEnabled helper (and in componentDerivedValues), although the entry already declares dependsOn: [muster, kagent].

Every further platform agent, or any component that only makes sense with its dependencies, needs another eq .name ... branch in a helper every render calls many times. A generic entry key (for example requiresDependsOn: true, meaning on only while every dependsOn is on) would express it once in the roster with no per-name code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this as is. componentEnabled already handles followers by name (kagent-crds, substrate, agent-platform-mcps, workspace-manager, agent-platform-operator), so default-agent follows the existing pattern. A generic "on only while every dependsOn is on" rule would change the meaning of dependsOn for every component; that belongs in its own change, if a second platform agent ever needs it.

again = subprocess.run([str(ROOT / "hack/stamp-release-commit.sh"), SHA, f"{tmp}/9.9.9/agent-platform"], capture_output=True, text=True)
if again.returncode == 0:
fail("hack/stamp-release-commit.sh passes on a chart with nothing to stamp")
v = find(render(release, *ON), "HelmRelease", NAME)["spec"]["values"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The stamped skills values are only compared to an expected dict and never rendered against the agent chart. verify-components-charts (also in the strict tag run) renders the unstamped working tree, where skills is [].

A shape the agent chart refuses in the five skills entries (path, git.url, commit) passes every check and first fails on installations after a release. Render the stamped release's default-agent values against the pulled agent chart (as render_component does) in this test.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Agreed that this is a gap, but out of scope here. verify-components-charts renders every component against its real chart, so the natural fix is to feed it the stamped render. That touches the strict tag run, so I'd rather do it separately than widen this PR.

Comment thread docs/reference.md Outdated

### General Purpose Agent and skills

The General Purpose Agent is the agent the platform ships, `default-agent` in the kagent namespace. A session starts with it unless the person picks another agent. Its prompt is in [`agents/default-agent/values.yaml`](../agents/default-agent/values.yaml) and its skills are in [`skills/`](../skills).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The link to ../agents/default-agent/values.yaml goes through the new root-level agents directory symlink, which GitHub's blob view does not resolve.

A reader clicking the prompt link on GitHub gets the symlink's one-line target text or a 404, not the values file. Link ../helm/agent-platform/agents/default-agent/values.yaml. Nothing else references the root agents symlink, so it can be dropped.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: the link now points at helm/agent-platform/agents/default-agent/values.yaml directly.

Comment thread scripts/validate_skills.py Outdated
- A skill is skills/<name>/SKILL.md. A SKILL.md anywhere else fails: a skill
source listed without a path is scanned whole and would offer it.
- Its YAML frontmatter parses to a mapping whose `name` is the directory name,
the name the Agent Manager's values pin it by (agents/agent-manager/values.yaml).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The docstring points at agents/agent-manager/values.yaml, which this PR does not ship (the Agent Manager agent stays with #1265). The Makefile help of verify-skills says it validates "against what the agent runtime accepts", which the docstring says it deliberately does not.

A maintainer looks for the pinning file and finds none, or relies on verify-skills to catch runtime-invalid frontmatter (length or field limits) that it never checks. Point at agents/default-agent/values.yaml and fix the Makefile description.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: the docstring names helm/agent-platform/agents/default-agent/values.yaml, and the verify-skills help now says it checks the layout only.

Comment thread tests/verify-components-charts.py Outdated
# OCIRepository (the same name; with the chart's version for one released
# with it, agent-platform.sourceName).
charts = {n: c["chart"] for n, c in components.items()}
charts = {n: n for n in components}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

charts = {n: n for n in components} is now an identity map kept only as indirection. The releasedWithChart branch still uses that key as the chart directory (REPO_ROOT / "helm" / chart), while verify-examples now uses components[name]["chart"].

For a releasedWithChart entry whose key differs from its chart (the case this PR introduces for agent), the check looks in helm/ and fails with "no chart at ...", while verify-examples renders the right directory. Drop the map and use components[name]["chart"] for the chart directory consistently.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 2cf1089: the identity map is gone. The release/OCIRepository name is the key, and the releasedWithChart branch looks up the chart directory from components[name]["chart"].

chart=${2:-helm/agent-platform}
placeholder='[[ .SHA ]]'

if ! [[ $commit =~ ^[0-9a-f]{40}$ ]]; then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Convention: it re-implements the agent chart's pin rule (a 40-hex commit), and that copy is narrower than the chart's own, which accepts 40- or 64-hex.

/Users/marian/tasks/2026-11-default-agent/wt-default-agent/CLAUDE.md: "Do not copy kagent, Substrate or chart rules into this repository." A SHA-256 repository commit would be refused here although the agent chart takes it, and the rule must be kept in sync by hand.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this as is. The check isn't a copy of the agent chart's rule: it guards the script's own input, a commit from git rev-parse HEAD, which is always 40 hex in this repository. Accepting what the chart accepts wouldn't catch anything more here.

echo "1/3 the llm-d controller's release {{ $controller.chart }}: its webhook denies every delete of a well-known config while it runs"
release {{ $controller.chart }}
echo "1/3 the llm-d controller's release kserve-llmisvc-resources: its webhook denies every delete of a well-known config while it runs"
release kserve-llmisvc-resources

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The release names are now string literals repeated in the echo, release and jq lines, although $controller and $configs are still looked up from the same roster entries.

Renaming either components key or adding a target prefix leaves the teardown deleting a release that does not exist (--ignore-not-found), so the serving teardown silently skips the llm-d controller and its webhook keeps blocking the config deletes. Bind $controllerName := "kserve-llmisvc-resources" once, or pass the key in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this as is. The literals come from #1265's naming change (releases are named after their key). Deriving them back from the roster would bring back the chart-name indirection this PR removes; a key rename has to touch this hook either way.

that CRD either, so the dependency is moot. */ -}}
{{- $awaitsSubstrate := and (eq $key "muster") (include "agent-platform.muster.awaitsSubstrate" (dict "root" $root "values" $vals)) }}
{{- $installDisableWait := or $c.installDisableWait $awaitsSubstrate }}
{{- $installDisableWait := or $c.installDisableWait $awaitsSubstrate $c.disableWait }}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The new disableWait key overlaps the existing installDisableWait key. Two roster knobs now set install.disableWait, and their documentation is spread over two paragraphs.

The next reader has to work out that installDisableWait means install only and disableWait means install and upgrade, and the verify-meta exemption keys on the release name instead of the knob. A single disableWait: install|always would carry both cases.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this as is. Both knobs come from the existing design: installDisableWait is install-only for the bootstrap case, and disableWait covers install and upgrade. Merging them into one enum is a reasonable cleanup, but it would change an existing key, so it should be its own change.

sys.exit(1)


def run(chart: str, *args: str) -> subprocess.CompletedProcess:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Efficiency: about 20 independent helm template renders and 3 copy-and-package runs of the 460 KB chart run sequentially. The neighbouring verify scripts (verify-components-charts) fan out with a ThreadPoolExecutor.

This adds several sequential seconds to every make verify-all, which runs on each push. Submit the independent renders to a pool, as verify-components-charts does.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving this for a follow-up. The target takes about 8 s in make verify-all locally (verify-components-charts: 7 s), so it adds little. Parallelising it the way verify-components-charts does is worth doing if verify-all time becomes a problem.

- klaus-gateway falls back to <kagent namespace>/default-agent, not the bare
  name it resolves in its own a2a.namespace
- the avatar URL follows the avatar route, extra entry labels are taken
- a values file that does not parse, or carries the release placeholder
  outside skills[].git.commit, fails the render
- the UPGRADE note asks to rename or delete an existing default-agent
- docs link, validator docstring, verify-skills help and the components-charts
  test name what they do

Towards giantswarm/giantswarm#39057
@marians

marians commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Closing, as Rotfuks will continue the work in his PRs

@marians marians closed this Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants