diff --git a/CHANGELOG.md b/CHANGELOG.md index b21f50b..4a8a7e3 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 (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 - 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/Chart.yaml b/helm/Chart.yaml index 5e38ef7..28cbe86 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 10cc378..858b726 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`, `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/templates/controller-statefulset.yaml b/helm/templates/controller-statefulset.yaml index 7df9101..feb4c7a 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 1d21a99..e74d278 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 7c9809f..6064064 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 56f4ebe..b57c4f7 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -126,6 +126,12 @@ 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; `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" # Node affinity passthrough (quant pins pods to a node_type= node).