Skip to content

Commit 443509c

Browse files
Merge remote-tracking branch 'origin/main' into pr-tracker-draft-kagent-3782
2 parents 6cad948 + 6f9ac38 commit 443509c

11 files changed

Lines changed: 305 additions & 156 deletions

File tree

‎.github/workflows/preview.yaml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ concurrency:
2222

2323
jobs:
2424
deploy:
25+
# Fork and Dependabot PRs cannot read the Cloudflare secrets, so the upload
26+
# would always fail. Skip the whole job for them instead.
27+
if: >-
28+
github.event.pull_request.head.repo.full_name == github.repository &&
29+
github.event.pull_request.user.login != 'dependabot[bot]'
2530
runs-on: ubuntu-latest
2631
# Declared explicitly so the comment step below does not depend on whatever
2732
# the repo-wide default token permission happens to be.

‎docs-site/content/kagent/main/agents/agent-harness.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ EOF
4242
| ----- | -------- | ----------- |
4343
| One of `kagent`, `codex`, `claude`, `byo` | Yes | The harness that executes the agent. Naming none, or more than one, is rejected. To compare the four harnesses, see [Choose a harness](#choose-a-harness). |
4444
| `workload.image` | For `byo` | The container image to run, pinned by `sha256` digest. A tag with no digest is rejected, because a revision must be reproducible. Omit it on a `kagent`, `codex`, or `claude` Harness to run the built-in image of the installed release. For more information, see [Built-in runtime images](#built-in-runtime-images). |
45-
| `workload.command` | For `byo` | Overrides the image entrypoint, up to 32 entries. Required for the `byo` harness, optional otherwise. Every harness honors an explicit value, the `kagent` harness included, regardless of the language its image is written in. |
46-
| `workload.args` | No | Overrides the image arguments, up to 64 entries. An override that you omit stays unset rather than taking a default. |
45+
| `workload.command` | For `byo` | Overrides the image entrypoint, up to 32 entries. Required for the `byo` harness and optional for the `kagent` harness. The `claude` and `codex` harnesses reject this field. The API server rejects an empty list. |
46+
| `workload.args` | No | Overrides the image arguments, up to 64 entries. The `kagent` and `byo` harnesses accept this field, and the `claude` and `codex` harnesses reject it. An override that you omit stays unset. The API server rejects an empty list. |
4747
| `env` | No | Environment variables for the agent process. Each entry sets a literal `value`, which is required and can be an empty string. The schema does not define a secret-backed source, so the API server rejects a `credentialRef` entry as an unknown field. Put credentials in a ModelConfig or a RemoteMCPServer instead. For more information, see [About model providers]({{< link path="setup/model-providers/about-model-providers#credentials-that-kagent-rejects" >}}). Limits and reserved names both apply. For more information, see [Environment variables on an Actor](#environment-variables-on-an-actor). |
4848
| `substrate.workerPoolRef.name` | Yes | The {{< gloss "WorkerPool" >}}WorkerPool{{< /gloss >}} that this Harness's Actors are scheduled onto. An operator must provision one before any agent can run. |
4949
| `substrate.snapshotPolicy.location` | Yes | The object storage location for Actor {{< gloss "Snapshot" >}}snapshots{{< /gloss >}}. |

‎docs-site/content/kagent/main/agents/bring-your-own-agent.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ EOF
122122
| ----- | -------- | ----------- |
123123
| `byo` | Yes | Selects this harness. The object is always empty, and naming a second harness alongside it is rejected. |
124124
| `workload.image` | Yes | Your image, pinned by `sha256` digest. A tag alone is rejected, because a revision must be reproducible. |
125-
| `workload.command` | Yes | The entrypoint to run, up to 32 entries. Required for `byo` and optional for every other harness. |
125+
| `workload.command` | Yes | The entrypoint to run, up to 32 entries. Required for `byo` and optional for the `kagent` harness. The `claude` and `codex` harnesses reject this field. |
126126
| `env` | No | Any setting that your image reads. Each entry takes a literal `value` only. Put credentials in a ModelConfig or a RemoteMCPServer instead. |
127127

128128
An opaque agent's AgentTemplate sets only a description for the agent card. An Agent then pairs it with the Harness.
@@ -215,7 +215,9 @@ return application.Run()
215215
For a complete executor, see [`go/core/test/byoa2a/main.go`](https://github.com/kagent-dev/kagent/blob/main/go/core/test/byoa2a/main.go) in the kagent repository.
216216
{{% /tab %}}
217217
{{% tab name="Python" %}}
218-
The `kagent-adk` package provides helpers for agents that are built with the Google Agent Development Kit (ADK). `KAgentApp` wraps an ADK agent rather than an arbitrary framework, serves A2A over gRPC, and answers the readiness endpoint on 8081. `materialize_from_bootstrap` fetches the bootstrap bundle and writes its documents to `/config`, and `KAgentConfig.from_file` reads the `runtime` object back. The listener defaults to `[::]:80`, which matches what kagent dials.
218+
The `kagent-adk` package provides helpers for agents that are built with the Google Agent Development Kit (ADK). `KAgentApp` wraps an ADK agent, serves A2A over gRPC, and answers the readiness endpoint on 8081. `materialize_from_bootstrap` fetches the bootstrap bundle and writes its documents to `/config`, and `KAgentConfig.from_file` reads the `runtime` object back. The listener defaults to `[::]:80`, which matches what kagent dials.
219+
220+
The `kagent-langgraph`, `kagent-crewai`, and `kagent-openai` packages each provide a `KAgentApp` helper that serves A2A in the same way. With every helper, start the server with `app.build().run()`. An entry point that passes `app.build()` to Uvicorn, as earlier releases required, does not serve gRPC.
219221

220222
```python
221223
from kagent.adk import KAgentApp
@@ -229,7 +231,8 @@ app = KAgentApp(
229231
agent_card=card,
230232
kagent_api_url=config.api_url,
231233
app_name=config.app_name,
232-
).build()
234+
)
235+
app.build().run()
233236
```
234237

235238
`from_file` raises `ValueError` when the document omits `control_plane_url`, `gateway_url`, `name`, or `namespace`. Because `from_file` only reads the file, a standalone process that runs outside Agent Substrate skips `materialize_from_bootstrap` and supplies its own `/config/config.json`.
@@ -247,7 +250,8 @@ app = KAgentApp(
247250
kagent_api_url=config.api_url,
248251
app_name=config.app_name,
249252
config=parse_config(Path("/config/config.json").read_text()),
250-
).build()
253+
)
254+
app.build().run()
251255
```
252256

253257
The `a2a_grpc_address` argument overrides both the default and the configured address.
@@ -270,7 +274,6 @@ The kagent helpers also save the bundle to `/data/kagent/bootstrap/bundle.pb`, a
270274
## Known limitations
271275

272276
- **The A2A interface is fixed.** kagent advertises `http://127.0.0.1:80` over gRPC, and `spec.byo` does not take a field that changes the address, the port, or the protocol. An image that serves A2A over only HTTP JSON-RPC cannot run on this harness.
273-
- **The LangGraph, CrewAI, and OpenAI adapters do not satisfy the contract.** The `kagent-langgraph`, `kagent-crewai`, and `kagent-openai` packages each build a FastAPI application with A2A JSON-RPC routes, without a gRPC server. Running LangGraph, CrewAI, or the OpenAI Agents SDK under `byo` means serving A2A over gRPC yourself, as the **Any other language** tab in [Build the image](#build-the-image) describes.
274277
- **Skills load only when the image reads them.** kagent mounts each skill and plugin that an AgentTemplate attaches, and describes them in the agent configuration. The Go helper reads that description. The Python helper does not yet read it, so a Python image runs without its skills.
275278
- **Long-term memory is unavailable.** Memory is configured under `spec.kagent.memory`, and only the `kagent` harness wires it up. A `byo` Harness does not take an equivalent setting. For what a BYO image would need to replace, see [Agent memory]({{< link path="agents/agent-memory" >}}).
276279
- **A broken port mapping looks like a healthy agent.** For the failure and what avoids it, see [The A2A contract](#the-a2a-contract).

‎docs-site/content/kagent/main/examples/a2a-agents.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ Build the receiver around these rules:
348348

349349
* Any `2xx` response acknowledges a delivery. Every other response counts as a failed attempt, and a redirect is one of them, so register the final callback URL.
350350
* A delivery can arrive more than once, or out of order. Treat `GetTask` as the source of truth for the task's current state.
351-
* kagent makes up to ten attempts for each state that a task publishes, and the count carries across controller restarts. After the last attempt, kagent drops that delivery but keeps the callback registered, so the next state still reaches the receiver.
351+
* The controller makes up to 20 attempts for each state that a task publishes, and the count carries across controller restarts. Retry waits start at 5 seconds and double to a maximum of 60 seconds. After the last attempt, the controller drops that delivery but keeps the callback registered, so the next state still reaches the receiver.
352352
* kagent does not expose delivery status, so nothing reports whether a delivery failed.
353353

354354
To tune delivery, configure the following Helm values under `config.push`.
@@ -358,6 +358,7 @@ To tune delivery, configure the following Helm values under `config.push`.
358358
| `maxConcurrency` | `10` | The number of deliveries that each controller replica sends at once. Setting `1` sends them one at a time. |
359359
| `sendTimeout` | `5s` | How long one HTTP attempt can take before it counts as failed. |
360360
| `recoveryInterval` | `60s` | How often an idle controller scans for deliveries that a missed wake-up left pending. |
361+
| `signingKeyActivationDelay` | `300s` | How long the controller publishes a replacement signing key before it signs callbacks with the replacement key. Use a value that covers the interval at which the receiver refreshes its cached JSON Web Key Set (JWKS). The maximum is `86400s`. |
361362

362363
### Secure callback deliveries
363364

@@ -390,7 +391,9 @@ kagent does not generate its own signing key, so you are responsible for creatin
390391
--set config.push.issuer=https://kagent.example
391392
```
392393

393-
The issuer that a receiver trusts must match the host that it fetches the JSON Web Key Set (JWKS) from. When you omit `config.push.issuer`, Helm derives it from `ui.externalUrl` and then from the in-cluster A2A gateway URL. Either fallback can point to a host that does not serve the JWKS.
394+
The issuer that a receiver trusts must match the host that it fetches the JWKS from. When you omit `config.push.issuer`, Helm derives it from `ui.externalUrl` and then from the in-cluster A2A gateway URL. Either fallback can point to a host that does not serve the JWKS.
395+
396+
To rotate a key without interrupting signed deliveries, update the Secret, and set `config.push.signingKeyActivationDelay` to a value that covers the JWKS cache refresh of your receivers. The controller reloads the mounted key file every 15 seconds, publishes the replacement public key before it signs callbacks with the key, and adds a fixed 30-second buffer to the configured delay.
394397

395398
4. Confirm that the controller publishes a verification key. Before you set the Secret, this path returns `404`.
396399
```bash

‎docs-site/content/kagent/main/observability/metrics.md‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ author: kagent.dev
1111

1212
### Enable the metrics endpoint
1313

14-
The controller serves its metrics over HTTPS, and accepts a scrape only from a ServiceAccount that holds the `<fullname>-metrics-reader` ClusterRole. Enabling the endpoint creates a dedicated metrics Service and that ClusterRole.
14+
By default, the controller serves its metrics over HTTPS, and accepts a scrape only from a ServiceAccount that is bound to the `<fullname>-metrics-reader` ClusterRole. Enabling the endpoint creates a dedicated metrics Service and the metrics role-based access control (RBAC) resources.
1515

1616
```yaml
1717
controller:
@@ -23,12 +23,23 @@ config:
2323
secure: true
2424
```
2525
26-
These two sections divide the listener from its Kubernetes packaging. `config.metrics` sets the address that the controller binds and whether it serves over HTTPS. `controller.metrics` creates the Service, the ClusterRoles, and the optional ServiceMonitor. Setting `controller.metrics.enabled` to `false` overrides `config.metrics.bindAddress` with `0`, which disables the listener as well. Change the port through `config.metrics.bindAddress`, because the chart derives the Service `targetPort` and the pod `containerPort` from it at template time.
26+
These two sections divide the listener from its Kubernetes packaging. `config.metrics` sets the address that the controller binds and whether it serves over HTTPS. `controller.metrics` creates the Service and the optional ServiceMonitor. When `config.metrics.secure` is set to `true`, it also creates the metrics ClusterRoles and ClusterRoleBinding. When `controller.metrics.enabled` is set to `false`, the chart overrides `config.metrics.bindAddress` with `0`. The `0` value also turns off the listener. The chart derives the Service `targetPort` and the pod `containerPort` from `config.metrics.bindAddress` at template time, so to change the port, set `config.metrics.bindAddress`.
27+
28+
To serve metrics over plain HTTP without authentication or authorization, set `config.metrics.secure` to `false`. With this setting, the chart omits the metrics RBAC resources, including when `rbac.namespaces` or `global.watchNamespaces` restricts the installation to specific namespaces. The Service keeps port `8443`, and the name of the port changes from `https` to `http-metrics`.
29+
30+
```yaml
31+
controller:
32+
metrics:
33+
enabled: true
34+
config:
35+
metrics:
36+
secure: false
37+
```
2738

2839
Grant your Prometheus instance access in one of the following ways.
2940

30-
- **With the Prometheus Operator**: Set `controller.metrics.serviceMonitor.enabled` to `true`. The chart creates a ServiceMonitor for the metrics Service. Also set `controller.metrics.serviceMonitor.prometheusServiceAccount.name` and `.namespace` to the ServiceAccount that Prometheus runs as, and the chart binds the metrics reader ClusterRole to it. The chart renders the ServiceMonitor only when the cluster serves the `monitoring.coreos.com/v1` API. For an example, see [OTel stack]({{< link path="observability/otel-stack#send-kagent-telemetry-to-the-collector" >}}).
31-
- **Without the Prometheus Operator**: Bind the `<fullname>-metrics-reader` ClusterRole to the Prometheus ServiceAccount yourself, and add a scrape job for the `<fullname>-controller-metrics` Service on port `8443`. The job must use HTTPS, send the ServiceAccount token, and skip verification of the controller's self-signed certificate. For an example, see [Lightweight OTel stack]({{< link path="observability/lightweight-otel-stack#install-prometheus" >}}).
41+
- **With the Prometheus Operator**: Set `controller.metrics.serviceMonitor.enabled` to `true`. The chart creates a ServiceMonitor for the metrics Service. When `config.metrics.secure` is set to `true`, also set `controller.metrics.serviceMonitor.prometheusServiceAccount.name` and `.namespace` to the ServiceAccount that Prometheus runs as, and the chart binds the metrics reader ClusterRole to it. The chart renders the ServiceMonitor only when the cluster serves the `monitoring.coreos.com/v1` API. For an example, see [OTel stack]({{< link path="observability/otel-stack#send-kagent-telemetry-to-the-collector" >}}).
42+
- **Without the Prometheus Operator**: Add a scrape job for the `<fullname>-controller-metrics` Service on port `8443`. When `config.metrics.secure` is set to `true`, bind the `<fullname>-metrics-reader` ClusterRole to the Prometheus ServiceAccount yourself. The job must use HTTPS, send the ServiceAccount token, and skip verification of the controller's self-signed certificate. When `config.metrics.secure` is set to `false`, the job uses plain HTTP and does not send a token. For an example, see [Lightweight OTel stack]({{< link path="observability/lightweight-otel-stack#install-prometheus" >}}).
3243

3344
### Metric reference
3445

@@ -45,7 +56,6 @@ Besides the standard Go runtime and process metrics, the controller reports the
4556
| `kagent_runtime_revision_gc_pending` | Gauge | Runtime revisions that the last successful discovery found eligible for cleanup. The controller reports a cached count, so a scrape does not make a database or network call. The metric is absent until a discovery succeeds, and `0` reports a discovery that matched nothing. A failed discovery holds the previous value rather than clearing it. |
4657
| `kagent_runtime_revision_gc_duration_seconds` | Histogram | Time that one cleanup attempt takes, by the `kagent_gc_stage` label: `discovery` or `collection`. A `discovery` attempt covers the database query that lists every revision eligible for cleanup, and it updates `kagent_runtime_revision_gc_pending`. A `collection` attempt covers the database claim, the Agent Substrate read and deletion, and the database finalization. A failed attempt carries an `error_type` label holding a gRPC status code name, or `_OTHER` for every other failure, so the series that carry the label give both the failure rate and the reason. |
4758

48-
{{% version exclude-if="1.0.x,0.x" %}}
4959
The controller also reports the following counters.
5060

5161
| Metric | Type | Measures |
@@ -54,7 +64,6 @@ The controller also reports the following counters.
5464
| `kagent_push_delivery_claimed_total` | Counter | Push delivery attempts that the controller acquired before delivery I/O. Push retries count as separate attempts, and a claim counts even when later delivery fails. |
5565

5666
The session quiescence and push delivery counters carry the `kagent_worker_trigger` label. The label value is `signal`, `recovery`, `startup`, `retry`, or `backlog`. Use `recovery` to count timer-driven discoveries of work. Follow-on claims use `backlog`, including worker handoffs and push delivery capacity refills. Empty scans and failed claim requests do not increase either counter. When the recovery timer finds work, the controller also writes the `recovery scan found work` log message with the `operation`, `recovery_interval_seconds`, and first `session_id` or `registration_id` fields.
57-
{{% /version %}}
5867

5968
The Agent Substrate `atecontroller` component reports the same `controller_runtime_*` and `workqueue_*` metrics for its own reconcilers. To keep the two apart in a query, filter by the scrape job, such as `job="kagent-controller-metrics"` in the OTel stack.
6069

@@ -143,12 +152,10 @@ Run the following queries in Prometheus or Grafana.
143152
sum by (controller) (rate(controller_runtime_reconcile_errors_total{job="kagent-controller-metrics"}[5m]))
144153
```
145154

146-
{{% version exclude-if="1.0.x,0.x" %}}
147155
- Timer-driven session quiescence discoveries in the last hour.
148156
```text
149157
increase(kagent_session_quiescence_claimed_total{kagent_worker_trigger="recovery"}[1h])
150158
```
151-
{{% /version %}}
152159

153160
- The 95th percentile agent invocation duration, per Agent. Because both stack guides configure the collector to derive the metric, the query covers every runtime that opens an `invoke_agent` span.
154161
```text

0 commit comments

Comments
 (0)