chore(sidebar): trace observer bridge agent statuses

Co-authored-by: Taylor Ho <taylorkmho@gmail.com>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
This commit is contained in:
npub1223z34hd7vtwc6qj4s7flsxkj644nlre2nthu7lrrmkumhu3xddsrx9r6w
2026-06-30 21:04:13 -07:00
parent 4a1892a651
commit f79514bd93

View File

@@ -151,6 +151,16 @@ function pillDiagEvent(event: RelayEvent) {
};
}
function pillDiagBridgeAgents(
agents: readonly Pick<ManagedAgent, "pubkey" | "status">[],
) {
return agents.map((agent) => ({
pubkey: normalizePubkey(agent.pubkey),
status: agent.status,
startsObserver: agent.status === "running" || agent.status === "deployed",
}));
}
function notifyListeners() {
for (const listener of listeners) {
listener();
@@ -499,6 +509,12 @@ export function useManagedAgentObserverBridge(
[agents],
);
pillDiagLog("bridge render", {
subscriptionId,
hasActiveAgent,
agents: pillDiagBridgeAgents(agents),
});
const agentPubkeys = React.useMemo(
() => agents.map((agent) => agent.pubkey),
[agents],