fix: heartbeat timing bugs — reset on sell, missing activation, ConfigMap race
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 20/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- go, helm, kubernetes
- Ambito
- backend, cli, devops, infrastructure
Direzione di ricerca
Leggi le modifiche elencate in internal/agent/agent.go, internal/tunnel/agent.go, internal/tunnel/tunnel.go, internal/openclaw/openclaw.go, internal/stack/stack.go e cmd/obol/sell.go. Riproduci i flussi di heartbeat e tunnel lifecycle, quindi esegui flow-06 e flow-09; il lavoro è completato quando l’heartbeat configurato di 5 minuti persiste e il lifecycle raggiunge Ready con il cleanup verificato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
The agent heartbeat has multiple timing bugs that cause it to silently fall back to the 30-minute default interval instead of the configured 5-minute interval. Discovered via automated user-flow validation (pi-autoresearch).
Root Causes
1. SyncAgentBaseURL resets heartbeat on every obol sell http
obol sell http → EnsureTunnelForSell → SyncAgentBaseURL → helmfile sync
↓
ConfigMap re-rendered WITHOUT heartbeat config
↓
OpenClaw falls back to 30m default
Every obol sell http call triggers a helmfile sync that overwrites the openclaw-config ConfigMap. The Helm chart's _helpers.tpl does not render agents.defaults.heartbeat by default, so the heartbeat config is lost.
Fix: Added patchHeartbeatAfterSync() — re-patches the ConfigMap with every: "5m" after each helmfile sync. Also added idempotency: skip sync entirely when the tunnel URL hasn't changed.
2. Heartbeat not activated after obol agent init
Init() injects HEARTBEAT.md but doesn't ensure the ConfigMap has the heartbeat interval set. On a fresh cluster, the first obol agent init leaves the heartbeat at the chart default (30m or none).
Fix: Added ensureHeartbeatActive() — reads the ConfigMap, checks for agents.defaults.heartbeat, patches if missing.
3. Chokidar hot-reload misses ConfigMap symlink swaps
Kubernetes updates ConfigMaps by swapping symlinks (..data → ..2026_03_19_...). The chokidar file watcher inside OpenClaw uses inotify, which doesn't reliably detect symlink target changes. Result: the pod starts with whatever config was present at boot, and ConfigMap patches applied later are silently ignored until the next pod restart.
Fix: After patching the heartbeat ConfigMap, perform a rollout restart to ensure the new pod starts with the correct config loaded.
4. Incorrect pod restart on heartbeat patch (removed)
The old code was restarting the pod after every heartbeat ConfigMap patch, even though OpenClaw's hot-reload should handle it. This caused unnecessary downtime during obol agent init.
Fix: Removed the pod restart from the patch path. The rollout restart in fix #3 handles the deterministic case.
Impact
Without these fixes, the heartbeat fires every 30 minutes instead of 5 minutes. This means:
- ServiceOffer reconciliation takes 30+ minutes instead of ~5 minutes
- Users see
obol sell statusstuck in non-Ready state for extended periods - The monetize guide tells users to "wait ~60s for agent heartbeat" but it actually takes 30 minutes
Files Changed
| File | Change |
|---|---|
internal/agent/agent.go |
ensureHeartbeatActive(), simplified Init() |
internal/tunnel/agent.go |
patchHeartbeatAfterSync(), idempotent sync |
internal/tunnel/tunnel.go |
Tunnel stop, storefront cleanup, state management |
internal/openclaw/openclaw.go |
Removed incorrect restart from heartbeat patch |
internal/stack/stack.go |
Backend detection for host IP resolution |
cmd/obol/sell.go |
Tunnel lifecycle (auto-start on sell, auto-stop on last delete) |
Verification
Validated by pi-autoresearch running 39 experiments with 90/90 flow steps passing, including:
- flow-06:
obol sell http→ pollobol sell status→ all conditions Ready within 8 minutes - flow-09: full lifecycle (sell → stop → delete → verify cleanup)
The heartbeat consistently fires within 5 minutes across all test runs.
- Lingua principale
- Go
- Stelle
- 11
- Fork
- 1
- Merge medio
- 1h 20m
- PR unite (30g)
- 39
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ObolNetwork/obol-stack
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ObolNetwork/obol-stack#612 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
ObolNetwork/obol-stack#829 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
ObolNetwork/obol-stack#828 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ObolNetwork/obol-stack#821 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ObolNetwork/obol-stack#807 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di ObolNetwork/obol-stack
Issue simili
-
bug frontend good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
trust: update-propagation-directive requires developer mode while add and remove do notForse già presa @bhuvan-somisetty l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
oalders/clodhopper#133 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
peasant-labs/peasant#596 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hatchet-dev/hatchet#5179 ·
I maintainer di solito rispondono entro 1 giorno