From 788b2c28203c042b065d048fbb6f0c6b8f9e4a2c Mon Sep 17 00:00:00 2001 From: Benjamin Borbe Date: Mon, 16 Nov 2026 00:20:55 +0100 Subject: [PATCH 1/2] feat(chart): expose keel policy as keel.policy value defaulting to all --- CHANGELOG.md | 4 ++++ helm/README.md | 1 + helm/templates/controller-statefulset.yaml | 2 +- helm/templates/executor-deployment.yaml | 4 ++-- helm/templates/recurring-task-creator-statefulset.yaml | 2 +- helm/values.yaml | 5 +++++ 6 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b21f50b1..1012b5f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,10 @@ Please choose versions by [Semantic Versioning](http://semver.org/). * MINOR version when you add functionality in a backwards-compatible manner, and * PATCH version when you make backwards-compatible bug fixes. +## Unreleased + +- feat(chart): **expose the keel policy as `keel.policy` instead of a hardcoded `force` literal.** `keel.sh/policy: force` was written into all four annotation blocks across three templates, and only `keel.enabled` / `keel.pollSchedule` were values, so the policy could not be set from a values file and an edit made on the live object was rewritten by the next apply. The templates now render `{{ .Values.keel.policy }}`, defaulting to `all` — the policy chosen on 2026-11-09, when `all` was preferred over removing the annotation because removal also stops image updates. Behaviour change for anyone relying on the old default: a `keel.enabled: true` render now emits `policy: all` rather than `force`. `keel.sh/match-tag` stays a literal and is not converted here. Change set: `helm/values.yaml`, `helm/templates/executor-deployment.yaml`, `helm/templates/controller-statefulset.yaml`, `helm/templates/recurring-task-creator-statefulset.yaml`, `helm/README.md`, `CHANGELOG.md`. + ## v0.146.0 - feat(delivery): **carry the run's four token counts onto the task file.** `ClaudeResult` already parses `input_tokens`, `output_tokens`, `cache_read_input_tokens` and `cache_creation_tokens` and meters them to Prometheus, but `AgentResultInfo` and the deliverer carried only turns and interaction count, so the counts never reached the vault. They now flow `ClaudeResult` → `Result` → `AgentResultInfo` → the published frontmatter as `metrics_input_tokens`, `metrics_output_tokens`, `metrics_cache_read_tokens` and `metrics_cache_creation_tokens`, and each run is also appended to a `metrics_runs` history list — the flat keys are last-write-wins, so a redriven task would otherwise lose earlier runs and a per-window budget would undercount. A run with no usage summary publishes no token key rather than a false zero, matching the existing turn-count absence rule. Change set: `agent_status.go`, `agent_step.go`, `agent_runner.go`, `claude/agent-step.go`, `delivery/result-deliverer.go`, `delivery/result-deliverer_test.go`, `CHANGELOG.md`. diff --git a/helm/README.md b/helm/README.md index 10cc378c..363f44e4 100644 --- a/helm/README.md +++ b/helm/README.md @@ -93,6 +93,7 @@ agents: [] | `image.pullPolicy` | `IfNotPresent` | Container image pull policy. | | `image.pullSecrets` | `[]` | Pull secret(s), e.g. `[{name: docker}]`. Empty for public `docker.io`. | | `keel.enabled` | `false` | Emit keel auto-redeploy annotations (registry poll). Off = versioned deploys. | +| `keel.policy` | `all` | Value of the `keel.sh/policy` annotation: `all`, `force`, `poll`, `glob`. Was a hardcoded `force` literal, so it could not be set here. | | `keel.pollSchedule` | `@every 1m` | keel poll interval when enabled. | | `affinity` | `{}` | Node affinity object applied to controller/executor/recurring pods. Empty = none. | | `rolloutNonce` | `""` | Value of a `random` pod annotation to force a rollout. Empty = omit. | diff --git a/helm/templates/controller-statefulset.yaml b/helm/templates/controller-statefulset.yaml index 7df91014..feb4c7a4 100644 --- a/helm/templates/controller-statefulset.yaml +++ b/helm/templates/controller-statefulset.yaml @@ -11,7 +11,7 @@ metadata: {{- include "agent.labels" $ | nindent 4 }} annotations: {{- if $.Values.keel.enabled }} - keel.sh/policy: force + keel.sh/policy: {{ $.Values.keel.policy }} keel.sh/trigger: poll keel.sh/match-tag: "true" keel.sh/pollSchedule: {{ $.Values.keel.pollSchedule | quote }} diff --git a/helm/templates/executor-deployment.yaml b/helm/templates/executor-deployment.yaml index 1d21a997..e74d2786 100644 --- a/helm/templates/executor-deployment.yaml +++ b/helm/templates/executor-deployment.yaml @@ -9,7 +9,7 @@ metadata: {{- include "agent.labels" . | nindent 4 }} annotations: {{- if .Values.keel.enabled }} - keel.sh/policy: force + keel.sh/policy: {{ .Values.keel.policy }} keel.sh/trigger: poll keel.sh/match-tag: "true" keel.sh/pollSchedule: {{ .Values.keel.pollSchedule | quote }} @@ -238,7 +238,7 @@ metadata: {{- include "agent.labels" $ | nindent 4 }} annotations: {{- if $.Values.keel.enabled }} - keel.sh/policy: force + keel.sh/policy: {{ $.Values.keel.policy }} keel.sh/trigger: poll keel.sh/match-tag: "true" keel.sh/pollSchedule: {{ $.Values.keel.pollSchedule | quote }} diff --git a/helm/templates/recurring-task-creator-statefulset.yaml b/helm/templates/recurring-task-creator-statefulset.yaml index 7c9809fb..6064064f 100644 --- a/helm/templates/recurring-task-creator-statefulset.yaml +++ b/helm/templates/recurring-task-creator-statefulset.yaml @@ -74,7 +74,7 @@ metadata: {{- include "agent.labels" . | nindent 4 }} annotations: {{- if .Values.keel.enabled }} - keel.sh/policy: force + keel.sh/policy: {{ .Values.keel.policy }} keel.sh/trigger: poll keel.sh/match-tag: "true" keel.sh/pollSchedule: {{ .Values.keel.pollSchedule | quote }} diff --git a/helm/values.yaml b/helm/values.yaml index 56f4ebef..0ee2373f 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -126,6 +126,11 @@ image: # versioned deploys don't need it; bump image.tag + re-apply instead. keel: enabled: false + # keel.sh/policy — `all` takes any newer tag keel sees, `force` deploys + # regardless of tag, `poll`/`glob` are the narrower modes. Previously a + # hardcoded `force` literal in every template, so the policy could not be + # set from values and a live edit was reverted by the next apply. + policy: all pollSchedule: "@every 1m" # Node affinity passthrough (quant pins pods to a node_type= node). From 4346d3fbfd05689766f1d6ca8fe93e65c689781e Mon Sep 17 00:00:00 2001 From: Benjamin Borbe Date: Mon, 16 Nov 2026 00:37:30 +0100 Subject: [PATCH 2/2] fix(chart): correct the keel policy value list and bump chart to 0.23.22 --- CHANGELOG.md | 2 +- helm/Chart.yaml | 12 ++++++------ helm/README.md | 2 +- helm/values.yaml | 7 ++++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1012b5f7..4a8a7e33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ Please choose versions by [Semantic Versioning](http://semver.org/). ## Unreleased -- feat(chart): **expose the keel policy as `keel.policy` instead of a hardcoded `force` literal.** `keel.sh/policy: force` was written into all four annotation blocks across three templates, and only `keel.enabled` / `keel.pollSchedule` were values, so the policy could not be set from a values file and an edit made on the live object was rewritten by the next apply. The templates now render `{{ .Values.keel.policy }}`, defaulting to `all` — the policy chosen on 2026-11-09, when `all` was preferred over removing the annotation because removal also stops image updates. Behaviour change for anyone relying on the old default: a `keel.enabled: true` render now emits `policy: all` rather than `force`. `keel.sh/match-tag` stays a literal and is not converted here. Change set: `helm/values.yaml`, `helm/templates/executor-deployment.yaml`, `helm/templates/controller-statefulset.yaml`, `helm/templates/recurring-task-creator-statefulset.yaml`, `helm/README.md`, `CHANGELOG.md`. +- feat(chart): **expose the keel policy as `keel.policy` instead of a hardcoded `force` literal (chart 0.23.22).** `keel.sh/policy: force` was written into all four annotation blocks across three templates, and only `keel.enabled` / `keel.pollSchedule` were values, so the policy could not be set from a values file and an edit made on the live object was rewritten by the next apply. The templates now render `{{ .Values.keel.policy }}`, defaulting to `all` — the policy chosen on 2026-11-09, when `all` was preferred over removing the annotation because removal also stops image updates. Behaviour change for anyone relying on the old default: a `keel.enabled: true` render now emits `policy: all` rather than `force`. `keel.sh/match-tag` stays a literal and is not converted here. Change set: `helm/values.yaml`, `helm/templates/executor-deployment.yaml`, `helm/templates/controller-statefulset.yaml`, `helm/templates/recurring-task-creator-statefulset.yaml`, `helm/README.md`, `CHANGELOG.md`. ## v0.146.0 diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 5e38ef71..28cbe863 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -3,12 +3,12 @@ name: agent description: bborbe agent framework — event-driven, Kafka-based, K8s-native task platform (controller, executor, and example agents) type: application # Chart version — bumped on chart changes, independent of appVersion. -# 0.23.20 adds `executor.env` / `executors[].env`: the values dict is merged -# verbatim into the executor container env, last so it can override a rendered -# name. Without it a setting the executor binary reads but the chart does not -# model is unreachable — a values key the template ignores is a silent no-op, -# and an operator edit to the live Deployment is dropped by the next apply. -version: 0.23.21 +# 0.23.22 exposes `keel.policy` (default `all`): the keel.sh/policy annotation +# was a hardcoded `force` literal in every template, so the policy could not be +# set from values and an operator edit to the live Deployment was dropped by +# the next apply. 0.23.21 rendered `spec.tokenCeiling`; 0.23.20 added +# `executor.env` / `executors[].env`. +version: 0.23.22 # Default image tag for the framework components when values don't override. appVersion: "0.3.1" home: https://github.com/bborbe/agent diff --git a/helm/README.md b/helm/README.md index 363f44e4..858b726e 100644 --- a/helm/README.md +++ b/helm/README.md @@ -93,7 +93,7 @@ agents: [] | `image.pullPolicy` | `IfNotPresent` | Container image pull policy. | | `image.pullSecrets` | `[]` | Pull secret(s), e.g. `[{name: docker}]`. Empty for public `docker.io`. | | `keel.enabled` | `false` | Emit keel auto-redeploy annotations (registry poll). Off = versioned deploys. | -| `keel.policy` | `all` | Value of the `keel.sh/policy` annotation: `all`, `force`, `poll`, `glob`. Was a hardcoded `force` literal, so it could not be set here. | +| `keel.policy` | `all` | Value of the `keel.sh/policy` annotation: `all`, `major`, `minor`, `patch`, `force`, `glob`. (`poll` is a `keel.sh/trigger` value, not a policy.) Was a hardcoded `force` literal, so it could not be set here. | | `keel.pollSchedule` | `@every 1m` | keel poll interval when enabled. | | `affinity` | `{}` | Node affinity object applied to controller/executor/recurring pods. Empty = none. | | `rolloutNonce` | `""` | Value of a `random` pod annotation to force a rollout. Empty = omit. | diff --git a/helm/values.yaml b/helm/values.yaml index 0ee2373f..b57c4f7c 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -126,9 +126,10 @@ image: # versioned deploys don't need it; bump image.tag + re-apply instead. keel: enabled: false - # keel.sh/policy — `all` takes any newer tag keel sees, `force` deploys - # regardless of tag, `poll`/`glob` are the narrower modes. Previously a - # hardcoded `force` literal in every template, so the policy could not be + # keel.sh/policy — `all` takes any newer tag keel sees; `major`/`minor`/`patch` + # are the semver-gated modes; `force` deploys regardless of tag; `glob` filters + # by tag pattern. (`poll` is a keel.sh/trigger value, not a policy.) Previously + # a hardcoded `force` literal in every template, so the policy could not be # set from values and a live edit was reverted by the next apply. policy: all pollSchedule: "@every 1m"