From edfc9767020ccfb92dada04eb47512ae97b174a9 Mon Sep 17 00:00:00 2001 From: Michael Feth Date: Fri, 11 Sep 2026 05:00:43 -0400 Subject: [PATCH] [lenny] fix(desktop): keep a lone live persona instance on its canonical card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `buildPersonaCards` split a persona into per-name cards whenever more than one display group existed, keying each split card `::`. It only collapsed back to the canonical persona card when *zero* live groups remained. With one archived instance and one live sibling, that left a single live group still travelling the split path, so the persona's only card was keyed `::` instead of ``. Every deep link to the persona — `persona-agent-row-` — then pointed at a card that no longer existed, and archived-profile navigation dead-ended. A split card only earns its own identity when a rival live name exists. With one live name left, the persona's name again stands for every surviving instance, so collapse on `liveGroups.length <= 1`. This regression is fork-local (47cc90626d, 3acf014ab3); it broke the upstream spec exact-key-profile.spec.ts:84 "archived exact key stays navigable (live sibling)", which had been failing on every PR and blocking the whole queue. Verified: exact-key-profile.spec.ts 4/4 passed (was 3 passed / 1 failed); desktop unit suite 6583/6583 passed. --- desktop/src/features/agents/ui/unifiedAgentGroups.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop/src/features/agents/ui/unifiedAgentGroups.ts b/desktop/src/features/agents/ui/unifiedAgentGroups.ts index 5dc8a0ae776..e3330bbab66 100644 --- a/desktop/src/features/agents/ui/unifiedAgentGroups.ts +++ b/desktop/src/features/agents/ui/unifiedAgentGroups.ts @@ -83,7 +83,12 @@ function buildPersonaCards( const liveGroups = displayGroups.filter( (group) => pickProfileAgent(group.agents, isArchived) !== undefined, ); - if (liveGroups.length === 0) return [personaOnlyCard(agents)]; + // A split card only earns its own identity when a *rival* live name exists. + // With one live name left (or none), the persona's name once again stands for + // every surviving instance, so the persona keeps its canonical card — and its + // canonical key. Splitting a lone survivor would rename the persona's only + // card to `::` and strand every deep link to the persona. + if (liveGroups.length <= 1) return [personaOnlyCard(agents)]; const ownerIndex = pickPersonaActionsIndex(persona, liveGroups); return liveGroups.map((group, index) => ({