Skip to content

Commit bc92538

Browse files
committed
fix(panda-chat): stable API_SERVER_KEY bearer to survive ArgoCD
The OW<->Hermes bearer was minted with randAlphaNum guarded by a lookup-preserve. Under ArgoCD that guard is a no-op (client-side `helm template` has no cluster connection), so every re-render mints a fresh key. Whichever of the OW/Hermes pods doesn't restart is stranded on the old bearer -> Hermes /v1/models 401s -> empty model picker. Prefer an explicit, stable credentials.apiServerKey (GitOps supplies it from sops); keep lookup-preserve + random only as the bare-helm-install fallback. Bumps chart 0.2.0 -> 0.3.0.
1 parent da4e85a commit bc92538

4 files changed

Lines changed: 28 additions & 10 deletions

File tree

charts/panda-chat/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: panda-chat
33
description: AI chat for an Ethereum devnet — an Open-WebUI front end backed by a NousResearch Hermes agent wired to the `panda` CLI, giving anyone access to devnet analytics (Xatu/Prometheus/Loki/Dora/Ethnode via panda-proxy), account funding (powfaucet) and join-the-devnet helpers.
44
home: https://github.com/ethpandaops/chat
55
type: application
6-
version: 0.2.0
6+
version: 0.3.0
77
# Hermes Agent upstream version (CalVer) baked into the panda-overlay image.
88
appVersion: "2026.6.5"
99
keywords:

charts/panda-chat/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# panda-chat
33

4-
![Version: 0.2.0](https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2026.6.5](https://img.shields.io/badge/AppVersion-2026.6.5-informational?style=flat-square)
4+
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2026.6.5](https://img.shields.io/badge/AppVersion-2026.6.5-informational?style=flat-square)
55

66
AI chat for an Ethereum devnet — an Open-WebUI front end backed by a NousResearch Hermes agent wired to the `panda` CLI, giving anyone access to devnet analytics (Xatu/Prometheus/Loki/Dora/Ethnode via panda-proxy), account funding (powfaucet) and join-the-devnet helpers.
77

@@ -109,6 +109,7 @@ open-webui:
109109
|-----|------|---------|-------------|
110110
| affinity | object | `{}` | Affinity for the agent pod |
111111
| chainId | string | `""` | The devnet chain id (informational; surfaced to the join-devnet skill). |
112+
| credentials.apiServerKey | string | `""` | Stable OW<->Hermes bearer (`API_SERVER_KEY`). Leave empty for a bare `helm install` (auto-generated + preserved). Under GitOps/ArgoCD you MUST set this to a stable value (sops) — `helm template` can't preserve a generated one, so an empty value drifts OW and Hermes apart on re-render. |
112113
| credentials.langfuse.publicKey | string | `""` | Langfuse public key (pk-lf-...) |
113114
| credentials.langfuse.secretKey | string | `""` | Langfuse secret key (sk-lf-...) |
114115
| credentials.llmApiKey | string | `""` | The LLM API key value (materialized into the Secret under `llm.apiKeyEnv`) |

charts/panda-chat/templates/secret.yaml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
11
{{/*
22
Two Secrets with a deliberate trust boundary between them:
33

4-
- <hermes>-secret: API_SERVER_KEY (Hermes bearer, generated once and
5-
preserved), <llm.apiKeyEnv> (model key) and HERMES_LANGFUSE_* (tracing
6-
keys). envFrom'd ONLY into the unprivileged hermes container.
4+
- <hermes>-secret: API_SERVER_KEY (Hermes bearer, see below), <llm.apiKeyEnv>
5+
(model key) and HERMES_LANGFUSE_* (tracing keys). envFrom'd ONLY into the
6+
unprivileged hermes container.
77
- <hermes>-panda-secret: PANDA_BOT_USERNAME / PANDA_BOT_TOKEN (the
88
Authentik service-account identity panda-server mints client_credentials
99
tokens with). envFrom'd ONLY into the panda-server sidecar. Hermes
1010
executes LLM-driven shell commands, so it must never share an
1111
environment (or container) with the bot credential.
1212
*/}}
13+
{{/*
14+
API_SERVER_KEY (OW <-> Hermes bearer) resolution, in priority order:
15+
1. credentials.apiServerKey — an explicit, STABLE value. GitOps supplies it
16+
from sops; this is the only source that survives ArgoCD, whose client-side
17+
`helm template` has no cluster connection (see 2).
18+
2. lookup-preserve of the existing in-cluster Secret. Works under a direct
19+
`helm upgrade`, but is a NO-OP under ArgoCD — so it must not be the only
20+
source, or every re-render mints a fresh bearer and OW/Hermes drift apart.
21+
3. randAlphaNum — first-install fallback for a bare `helm install`.
22+
*/}}
1323
{{- $secretName := include "panda-chat.secretName" . -}}
14-
{{- $existing := lookup "v1" "Secret" .Release.Namespace $secretName -}}
15-
{{- $bearer := "" -}}
16-
{{- if and $existing $existing.data -}}
17-
{{- with index $existing.data "API_SERVER_KEY" -}}
18-
{{- $bearer = . | b64dec -}}
24+
{{- $bearer := .Values.credentials.apiServerKey -}}
25+
{{- if not $bearer -}}
26+
{{- $existing := lookup "v1" "Secret" .Release.Namespace $secretName -}}
27+
{{- if and $existing $existing.data -}}
28+
{{- with index $existing.data "API_SERVER_KEY" -}}
29+
{{- $bearer = . | b64dec -}}
30+
{{- end -}}
1931
{{- end -}}
2032
{{- end -}}
2133
{{- if not $bearer -}}{{- $bearer = randAlphaNum 40 -}}{{- end -}}

charts/panda-chat/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ devnetTools:
9999

100100
# Credentials. Injected via vals `<path:...>` on devnets; set directly for standalone use.
101101
credentials:
102+
# -- Stable OW<->Hermes bearer (`API_SERVER_KEY`). Leave empty for a bare
103+
# `helm install` (auto-generated + preserved). Under GitOps/ArgoCD you MUST
104+
# set this to a stable value (sops) — `helm template` can't preserve a
105+
# generated one, so an empty value drifts OW and Hermes apart on re-render.
106+
apiServerKey: ""
102107
# -- The LLM API key value (materialized into the Secret under `llm.apiKeyEnv`)
103108
llmApiKey: ""
104109
panda:

0 commit comments

Comments
 (0)