diff --git a/desktop/src-tauri/src/commands/personas/update/concurrent_edit_tests.rs b/desktop/src-tauri/src/commands/personas/update/concurrent_edit_tests.rs index e02d7e4173..23263fe60d 100644 --- a/desktop/src-tauri/src/commands/personas/update/concurrent_edit_tests.rs +++ b/desktop/src-tauri/src/commands/personas/update/concurrent_edit_tests.rs @@ -36,6 +36,7 @@ fn persona(id: &str, display_name: &str, updated_at: &str) -> AgentDefinition { id: id.to_string(), display_name: display_name.to_string(), avatar_url: None, + description: None, system_prompt: "Do the work.".to_string(), runtime: None, model: None, @@ -151,6 +152,7 @@ fn update_request(id: &str, display_name: &str, expected: Option<&str>) -> Updat id: id.to_string(), display_name: display_name.to_string(), avatar_url: None, + description: None, system_prompt: "Do the work.".to_string(), runtime: None, model: None, @@ -459,6 +461,7 @@ async fn linked_instance_rename_completes_before_retain_error_propagates() { respond_to: Default::default(), respond_to_allowlist: vec![], display_name: Some("Alice".to_string()), + description: None, slug: None, runtime: None, name_pool: vec![], @@ -485,6 +488,7 @@ async fn linked_instance_rename_completes_before_retain_error_propagates() { id: "p1".to_string(), display_name: "Alice Renamed".to_string(), avatar_url: None, + description: None, system_prompt: "Do the work.".to_string(), runtime: None, model: None, diff --git a/desktop/src/shared/api/personaTypes.ts b/desktop/src/shared/api/personaTypes.ts index f18e9fe96b..8dd7cf2d9e 100644 --- a/desktop/src/shared/api/personaTypes.ts +++ b/desktop/src/shared/api/personaTypes.ts @@ -95,4 +95,11 @@ export type UpdatePersonaInput = { namePool?: string[]; envVars?: Record; behavior?: PersonaBehaviorInput; + /** + * Seed-time definition revision for the backend's lock-held compare-and-swap. + * When present the backend rejects the write if the persisted `updated_at` + * has advanced since the editor was seeded — preventing a stale full-replacement + * from clobbering a concurrent writer. Omit (undefined) to skip the check. + */ + expectedUpdatedAt?: string; };