fix(presence): list only running agents; a finished task's agent is not stale
deploy / plan (push) Failing after 1s
deploy / gate (push) Skipped
deploy / archied-image (push) Skipped
deploy / agent-image (push) Skipped
deploy / dist-zip (push) Skipped

This commit is contained in:
sam committed 2026-11-09 01:53:42 +11:00
1 parent 45b368af2e
commit d1b1bac4fb
2 files changed
+5 -5

No files matched your search

+3 -2
View File
@@ -139,10 +139,11 @@ func Mesh(records []storecontract.Presence, now time.Time) []Service {
if record.Service != Agent {
continue
}
// An agent reports for one task and stops when the task ends, so a
// silent agent is finished, not failed: only running agents are listed.
worker := Service{Presence: record, State: state(record, true, now)}
if worker.State == StateDown {
worker.Detail = ""
worker.Checks = nil
continue
}
workers = append(workers, worker)
}
+2 -3
View File
@@ -86,7 +86,6 @@ function problems(service: Service): { key: string; text: string }[] {
];
}
const stateLabel = (service: Service, agent: boolean) => (agent && service.state === "down" ? "stale" : service.state);
const reasons = (service: Service) => {
const found = problems(service).map((problem) => problem.text);
return found.length || !service.detail ? found : [service.detail];
@@ -129,14 +128,14 @@ onUnmounted(() => clearInterval(timer));
<Popover v-if="reasons(row).length">
<PopoverTrigger as-child>
<Button type="button" variant="ghost" class="h-auto rounded-sm p-0" :aria-label="`Why ${row.service} is ${row.state}`">
<Badge :variant="tone[row.state]">{{ stateLabel(row, table.agent) }}<ChevronDown data-icon="inline-end" /></Badge>
<Badge :variant="tone[row.state]">{{ row.state }}<ChevronDown data-icon="inline-end" /></Badge>
</Button>
</PopoverTrigger>
<PopoverContent align="start" class="w-96 max-w-[calc(100vw-2rem)] space-y-1 text-label">
<p v-for="reason in reasons(row)" :key="reason" class="break-words">{{ reason }}</p>
</PopoverContent>
</Popover>
<Badge v-else :variant="tone[row.state]">{{ stateLabel(row, table.agent) }}</Badge>
<Badge v-else :variant="tone[row.state]">{{ row.state }}</Badge>
</template>
</template>
</DataTable>