From 035f9c5d0f959f0d56f5470a27fd4a77030e7f19 Mon Sep 17 00:00:00 2001 From: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta Date: Sun, 19 Jul 2026 11:05:34 -0400 Subject: [PATCH] feat(desktop): route managed runtime lifecycle frames Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta Co-authored-by: Tyler Longwell Signed-off-by: Tyler Longwell --- desktop/src/features/agents/observerRelayStore.ts | 3 +++ desktop/src/shared/api/tauriManagedAgents.ts | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/desktop/src/features/agents/observerRelayStore.ts b/desktop/src/features/agents/observerRelayStore.ts index 919cbbc20c..035f19131e 100644 --- a/desktop/src/features/agents/observerRelayStore.ts +++ b/desktop/src/features/agents/observerRelayStore.ts @@ -4,6 +4,7 @@ import { subscribeToAgentObserverFrames } from "@/shared/api/observerRelay"; import type { RelayEvent, ManagedAgent } from "@/shared/api/types"; import type { ControlResultFrame } from "@/shared/api/types"; import { putAgentSessionConfig } from "@/shared/api/tauri"; +import { putManagedAgentRuntimeLifecycle } from "@/shared/api/tauriManagedAgents"; import { getIdentity } from "@/shared/api/tauriIdentity"; import { decryptObserverEvent } from "@/shared/api/tauriObserver"; import { @@ -402,6 +403,8 @@ async function handleRelayObserverEvent( onSessionConfigCaptured?.(agentPubkey); } else if (parsed.kind === "control_result") { dispatchControlResult(agentPubkey, parsed.payload); + } else if (parsed.kind === "managed_agent_runtime_lifecycle") { + void putManagedAgentRuntimeLifecycle(agentPubkey, parsed.payload); } } catch (error) { if (activeGeneration !== generation) { diff --git a/desktop/src/shared/api/tauriManagedAgents.ts b/desktop/src/shared/api/tauriManagedAgents.ts index 55713c1eac..c74b099f88 100644 --- a/desktop/src/shared/api/tauriManagedAgents.ts +++ b/desktop/src/shared/api/tauriManagedAgents.ts @@ -79,6 +79,16 @@ export async function restartManagedAgentRuntime( return invokeTauri("restart_managed_agent_runtime", { pubkey, relayUrl }); } +export async function putManagedAgentRuntimeLifecycle( + outerPubkey: string, + payload: unknown, +): Promise { + return invokeTauri("put_managed_agent_runtime_lifecycle", { + outerPubkey, + payload, + }); +} + export async function reconcileManagedAgentRuntimes( communities: readonly { relayUrl: string }[], ): Promise {