Keep delegated agents out of workspace alerts (#1293)

* Keep delegated agents out of workspace alerts

* Share delegated agent label parsing
This commit is contained in:
Mohamed Boudra
2026-06-02 20:55:19 +08:00
committed by GitHub
parent 4f3116d28a
commit 14af053c66
7 changed files with 233 additions and 7 deletions
+15
View File
@@ -1 +1,16 @@
export const PARENT_AGENT_ID_LABEL = "paseo.parent-agent-id";
export interface AgentLabelSource {
labels?: Record<string, unknown> | null;
}
export function getParentAgentIdFromLabels(labels: Record<string, unknown> | null | undefined) {
const parentAgentId = labels?.[PARENT_AGENT_ID_LABEL];
return typeof parentAgentId === "string" && parentAgentId.trim().length > 0
? parentAgentId.trim()
: null;
}
export function isDelegatedAgent(agent: AgentLabelSource): boolean {
return getParentAgentIdFromLabels(agent.labels) !== null;
}