From c23ccde24d6187d91cc0b17a5b3d31f481545dfb Mon Sep 17 00:00:00 2001 From: ShyamKumar1 Date: Fri, 29 May 2026 10:20:23 +0530 Subject: [PATCH] fix: prevent stale-runtime display on team lead for OpenCode teams The team lead's runtime is tracked via config.leadSessionId, not as a spawned runtime process. In the OpenCode adapter path, buildTeamAgentRuntimeSnapshot creates a synthetic runtime entry for the lead with alive:false (no CLI child pid) and no livenessKind, which the getCurrentRuntimeOfflineVisualState function then classifies as stale_runtime. This causes every team to show the lead as stale-runtime permanently. Add a guard in getCurrentRuntimeOfflineVisualState to skip the stale_runtime classification when the member is the team lead and the runtime entry carries the 'lead' backend marker. --- src/renderer/utils/memberHelpers.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/renderer/utils/memberHelpers.ts b/src/renderer/utils/memberHelpers.ts index 2f5b1d00..70a62df8 100644 --- a/src/renderer/utils/memberHelpers.ts +++ b/src/renderer/utils/memberHelpers.ts @@ -949,6 +949,16 @@ function getCurrentRuntimeOfflineVisualState( spawnBootstrapConfirmed: boolean | undefined, isTeamProvisioning: boolean | undefined ): MemberLaunchVisualState { + // The team lead's runtime is tracked via config.leadSessionId, not as a + // spawned runtime process. In the OpenCode adapter path, + // buildTeamAgentRuntimeSnapshot creates a synthetic runtime entry for the + // lead with alive:false (no CLI child pid) and no livenessKind — which the + // checks below would classify as stale_runtime. Skip lead entries that + // carry the lead backend marker so every team doesn't show the lead as + // "stale-runtime" permanently. + if (isLeadMember(member) && runtimeEntry?.backendType === 'lead') { + return null; + } if (runtimeEntry?.livenessKind === 'registered_only') { return 'registered_only'; }