From d4391c9097e5824277ebdb1572ccc8044ff3f5b5 Mon Sep 17 00:00:00 2001 From: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 Date: Mon, 3 Aug 2026 02:51:06 -0400 Subject: [PATCH] fix(desktop): restore commit_active_scope as test-only helper C4 removed commit_active_scope from identity_storage.rs (no longer called in production after the inline commit). app_state_scope_tests.rs uses it as a test helper to set up a live scope without running the full apply_workspace pipeline. Re-add it under #[cfg(test)] so tests continue to compile. Co-authored-by: Will Pfleger Signed-off-by: Will Pfleger --- desktop/src-tauri/src/identity_storage.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/desktop/src-tauri/src/identity_storage.rs b/desktop/src-tauri/src/identity_storage.rs index 5632179e7..32b0f5613 100644 --- a/desktop/src-tauri/src/identity_storage.rs +++ b/desktop/src-tauri/src/identity_storage.rs @@ -84,6 +84,18 @@ impl AppState { } crate::managed_agents::scope::next_scope_generation(); } + + /// Commit the active scope directly. Used by tests that need to set up a + /// live workspace without running the full `apply_workspace` pipeline. + #[cfg(test)] + pub(crate) fn commit_active_scope( + &self, + scope: crate::managed_agents::scope::WorkspaceAgentScope, + ) { + if let Ok(mut g) = self.active_agent_scope.lock() { + *g = Some(scope); + } + } } /// Pending-owned-channel overlay — moved here to keep `app_state.rs` within