From aec7fa4c0b0008037ebe3136860017e39dae3d49 Mon Sep 17 00:00:00 2001 From: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 Date: Tue, 23 Jun 2026 17:38:08 -0400 Subject: [PATCH] fix: tolerate missing private_key_nsec in agent store A keyring build migrates each agent nsec into the macOS Keychain and strips the inline private_key_nsec from the shared dev store. Without serde(default) the required field made an older build fail the whole serde_json::from_str at the first stripped record, taking down load_managed_agents, nest regen, and every agent. Widening read tolerance lets an old build survive a half-migrated store; the empty-key spawn-refusal path already handles the missing value downstream. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/src-tauri/src/managed_agents/types.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/desktop/src-tauri/src/managed_agents/types.rs b/desktop/src-tauri/src/managed_agents/types.rs index 51761a0f92..82445106c9 100644 --- a/desktop/src-tauri/src/managed_agents/types.rs +++ b/desktop/src-tauri/src/managed_agents/types.rs @@ -88,6 +88,9 @@ pub struct ManagedAgentRecord { pub name: String, #[serde(default)] pub persona_id: Option, + /// `#[serde(default)]` so an old build still parses a store whose inline + /// key was stripped after a keyring build migrated it into the Keychain. + #[serde(default)] pub private_key_nsec: String, /// NIP-OA auth tag JSON. Computed at agent creation time. ///