fix(coderd): exclude sub-agents from workspace health calculation (#21098)

This commit is contained in:
Mathias Fredriksson
2025-12-04 15:38:24 +02:00
committed by GitHub
parent 6aeb144a98
commit 532a1f3054
2 changed files with 82 additions and 0 deletions
+7
View File
@@ -2598,6 +2598,13 @@ func convertWorkspace(
failingAgents := []uuid.UUID{}
for _, resource := range workspaceBuild.Resources {
for _, agent := range resource.Agents {
// Sub-agents (e.g., devcontainer agents) are excluded from the
// workspace health calculation. Their health is managed by
// their parent agent, and temporary disconnections during
// devcontainer rebuilds should not affect workspace health.
if agent.ParentID.Valid {
continue
}
if !agent.Health.Healthy {
failingAgents = append(failingAgents, agent.ID)
}