@@ -3792,16 +3792,6 @@ private void UpdateSessionMainStatus(SessionInfo session, string sessionKey, Jso
37923792 return ;
37933793 }
37943794
3795- if ( item . ValueKind == JsonValueKind . Object
3796- && item . TryGetProperty ( "presentation" , out var presentation )
3797- && presentation . ValueKind == JsonValueKind . Object
3798- && TryGetRequiredBoolean ( presentation , "isMain" , out var presentationIsMain ) )
3799- {
3800- session . IsMain = presentationIsMain ;
3801- session . IsMainResolved = true ;
3802- return ;
3803- }
3804-
38053795 if ( item . ValueKind == JsonValueKind . Object
38063796 && item . TryGetProperty ( "isMain" , out var isMain )
38073797 && isMain . ValueKind is JsonValueKind . True or JsonValueKind . False )
@@ -3846,6 +3836,13 @@ private void PopulateSessionFromObject(SessionInfo session, JsonElement item)
38463836 session . Room = GetString ( item , "room" ) ;
38473837 if ( item . TryGetProperty ( "space" , out _ ) ) session . Space = GetString ( item , "space" ) ;
38483838 if ( item . TryGetProperty ( "chatType" , out _ ) ) session . ChatType = GetString ( item , "chatType" ) ;
3839+ if ( item . TryGetProperty ( "classification" , out _ ) ) session . Classification = GetString ( item , "classification" ) ;
3840+ if ( item . TryGetProperty ( "agentId" , out _ ) ) session . AgentId = GetString ( item , "agentId" ) ;
3841+ if ( item . TryGetProperty ( "accountId" , out _ ) ) session . AccountId = GetString ( item , "accountId" ) ;
3842+ if ( item . TryGetProperty ( "peerKind" , out _ ) ) session . PeerKind = GetString ( item , "peerKind" ) ;
3843+ if ( item . TryGetProperty ( "isBackground" , out var isBackground )
3844+ && isBackground . ValueKind is JsonValueKind . True or JsonValueKind . False )
3845+ session . IsBackground = isBackground . GetBoolean ( ) ;
38493846 if ( item . TryGetProperty ( "execNode" , out _ ) ) session . ExecNode = GetString ( item , "execNode" ) ;
38503847 if ( item . TryGetProperty ( "parentSessionKey" , out _ ) )
38513848 session . ParentSessionKey = GetString ( item , "parentSessionKey" ) ;
@@ -3859,12 +3856,6 @@ private void PopulateSessionFromObject(SessionInfo session, JsonElement item)
38593856 ? GetString ( origin , "label" )
38603857 : null ;
38613858 if ( item . TryGetProperty ( "worktree" , out _ ) ) session . Worktree = ParseSessionWorktree ( item ) ;
3862- if ( item . TryGetProperty ( "presentation" , out _ ) )
3863- session . Presentation = ParseSessionPresentation ( item ) ;
3864- if ( session . Presentation is { } presentation )
3865- {
3866- session . Channel ??= presentation . Channel ;
3867- }
38683859 if ( item . TryGetProperty ( "sessionId" , out var sessionId ) )
38693860 session . SessionId = sessionId . GetString ( ) ;
38703861 if ( item . TryGetProperty ( "thinkingLevel" , out var thinking ) )
@@ -3916,43 +3907,6 @@ private void PopulateSessionFromObject(SessionInfo session, JsonElement item)
39163907 : new SessionWorktreeInfo { Id = id , Branch = branch , RepoRoot = repoRoot } ;
39173908 }
39183909
3919- private static SessionPresentationInfo ? ParseSessionPresentation ( JsonElement item )
3920- {
3921- if ( ! item . TryGetProperty ( "presentation" , out var presentation )
3922- || presentation . ValueKind != JsonValueKind . Object )
3923- return null ;
3924-
3925- var title = GetString ( presentation , "title" ) ;
3926- var family = GetString ( presentation , "family" ) ;
3927- if ( title is null
3928- || family is null
3929- || ! TryGetRequiredBoolean ( presentation , "isMain" , out var isMain )
3930- || ! TryGetRequiredBoolean ( presentation , "isBackground" , out var isBackground ) )
3931- return null ;
3932-
3933- return new SessionPresentationInfo
3934- {
3935- Title = title ,
3936- TitleSource = GetString ( presentation , "titleSource" ) ?? "generated" ,
3937- Subtitle = GetString ( presentation , "subtitle" ) ,
3938- Family = family ,
3939- AgentId = GetString ( presentation , "agentId" ) ,
3940- Channel = GetString ( presentation , "channel" ) ,
3941- AccountId = GetString ( presentation , "accountId" ) ,
3942- PeerKind = GetString ( presentation , "peerKind" ) ,
3943- IsMain = isMain ,
3944- IsBackground = isBackground ,
3945- } ;
3946- }
3947-
3948- private static bool TryGetRequiredBoolean ( JsonElement parent , string propertyName , out bool value )
3949- {
3950- value = false ;
3951- if ( ! parent . TryGetProperty ( propertyName , out var property ) ) return false ;
3952- if ( property . ValueKind == JsonValueKind . True ) value = true ;
3953- return property . ValueKind is JsonValueKind . True or JsonValueKind . False ;
3954- }
3955-
39563910 private void ParseNodeList ( JsonElement nodesPayload )
39573911 {
39583912 try
0 commit comments