Summary
registerNode in the Go SDK agent hardcodes HeartbeatInterval: "0s" in the registration payload regardless of the agent's configured LeaseRefreshInterval, silently preventing the control plane from using the agent's intended check-in cadence.
Context
agent.go:684 constructs the node registration request with HeartbeatInterval: "0s". The agent's actual cfg.LeaseRefreshInterval is configured by the caller but never sent to the control plane. The control plane uses the registered heartbeat interval to calculate presence TTLs and schedule lease refresh windows. A hardcoded "0s" either causes the control plane to fall back to its own default (undocumented behavior) or to mark the node as expired immediately. Agents with custom refresh intervals (e.g. long-running batch agents) will have incorrect presence TTLs, causing premature eviction from the active node list.
Scope
In Scope
- Format
a.cfg.LeaseRefreshInterval as a Go duration string (e.g. "30s") and send it as HeartbeatInterval in the registration payload.
- If
LeaseRefreshInterval is zero, fall back to a documented default (e.g. "30s") rather than sending "0s".
- Document the fallback default in
AgentConfig godoc.
Out of Scope
- Changing the registration API schema on the control plane side (the field already exists).
- Modifying the lease refresh timer logic — just fix the registration payload.
- Adding dynamic heartbeat interval negotiation.
Files
sdk/go/agent/agent.go:684 — replace HeartbeatInterval: "0s" with HeartbeatInterval: formatDuration(a.cfg.LeaseRefreshInterval)
sdk/go/agent/agent.go — add a formatDuration helper (or inline) that formats a time.Duration as a string and returns a default when zero
sdk/go/agent/agent_test.go — test: agent registered with LeaseRefreshInterval: 45s sends HeartbeatInterval: "45s" in the registration payload; agent with zero interval sends the documented default
Acceptance Criteria
Notes for Contributors
Severity: LOW
Use time.Duration.String() to format durations — it produces the standard Go duration string format (e.g. "30s", "1m30s") that the control plane's time.ParseDuration can parse back. Cross-check the control plane's registration handler to confirm it accepts this format.
Summary
registerNodein the Go SDK agent hardcodesHeartbeatInterval: "0s"in the registration payload regardless of the agent's configuredLeaseRefreshInterval, silently preventing the control plane from using the agent's intended check-in cadence.Context
agent.go:684constructs the node registration request withHeartbeatInterval: "0s". The agent's actualcfg.LeaseRefreshIntervalis configured by the caller but never sent to the control plane. The control plane uses the registered heartbeat interval to calculate presence TTLs and schedule lease refresh windows. A hardcoded"0s"either causes the control plane to fall back to its own default (undocumented behavior) or to mark the node as expired immediately. Agents with custom refresh intervals (e.g. long-running batch agents) will have incorrect presence TTLs, causing premature eviction from the active node list.Scope
In Scope
a.cfg.LeaseRefreshIntervalas a Go duration string (e.g."30s") and send it asHeartbeatIntervalin the registration payload.LeaseRefreshIntervalis zero, fall back to a documented default (e.g."30s") rather than sending"0s".AgentConfiggodoc.Out of Scope
Files
sdk/go/agent/agent.go:684— replaceHeartbeatInterval: "0s"withHeartbeatInterval: formatDuration(a.cfg.LeaseRefreshInterval)sdk/go/agent/agent.go— add aformatDurationhelper (or inline) that formats atime.Durationas a string and returns a default when zerosdk/go/agent/agent_test.go— test: agent registered withLeaseRefreshInterval: 45ssendsHeartbeatInterval: "45s"in the registration payload; agent with zero interval sends the documented defaultAcceptance Criteria
LeaseRefreshIntervalasHeartbeatIntervalLeaseRefreshIntervalfalls back to a documented non-zero default"0s"is removedgo test ./sdk/go/...)make lint)Notes for Contributors
Severity: LOW
Use
time.Duration.String()to format durations — it produces the standard Go duration string format (e.g."30s","1m30s") that the control plane'stime.ParseDurationcan parse back. Cross-check the control plane's registration handler to confirm it accepts this format.