@@ -56,7 +56,6 @@ type Manager struct {
5656 replayMu sync.Mutex
5757 replays map [string ]* sessionReplay
5858 loadedSessions map [string ]bool
59- closedSessions map [string ]struct {}
6059}
6160
6261type sessionReplay struct {
@@ -76,7 +75,6 @@ func New(ctx context.Context, loadConfig agentclient.ConfigLoader, emit EventEmi
7675 emit : emit ,
7776 replays : make (map [string ]* sessionReplay ),
7877 loadedSessions : make (map [string ]bool ),
79- closedSessions : make (map [string ]struct {}),
8078 }
8179}
8280
@@ -411,9 +409,6 @@ func (m *Manager) NewSession(cwd string) (*Session, error) {
411409 sessionID := string (resp .SessionID )
412410 conversationID := m .scopedSessionID (sessionID )
413411 log .Printf ("[agent] NewSession created: id=%q" , sessionID )
414- m .mu .Lock ()
415- delete (m .closedSessions , conversationID )
416- m .mu .Unlock ()
417412 session := & Session {
418413 ID : sessionID ,
419414 Key : conversationID ,
@@ -497,9 +492,6 @@ func (m *Manager) ListSessions() ([]Session, error) {
497492 for _ , s := range resp .Sessions {
498493 session := Session {ID : string (s .SessionID ), Cwd : s .Cwd }
499494 session .Key = m .scopedSessionID (session .ID )
500- if m .IsSessionClosed (session .Key ) {
501- continue
502- }
503495 session .AgentID = m .currentAgentID ()
504496 session .AgentName = m .currentAgentID ()
505497 if s .Title != nil {
@@ -530,28 +522,9 @@ func (m *Manager) CloseSession(sessionID string) error {
530522 if err != nil {
531523 return err
532524 }
533- conversationID , acpSessionID := m .splitSessionRef (sessionID )
534- log .Printf ("[agent] CloseSession: id=%q acp=%q" , conversationID , acpSessionID )
525+ _ , acpSessionID := m .splitSessionRef (sessionID )
535526 _ , err = client .CloseSession (& acp.CloseSessionRequest {SessionID : acp .SessionID (acpSessionID )})
536- if err != nil {
537- log .Printf ("[agent] CloseSession failed: %v" , err )
538- return err
539- }
540- m .mu .Lock ()
541- m .closedSessions [conversationID ] = struct {}{}
542- delete (m .loadedSessions , conversationID )
543- m .mu .Unlock ()
544- return nil
545- }
546-
547- func (m * Manager ) IsSessionClosed (sessionID string ) bool {
548- if m == nil {
549- return false
550- }
551- m .mu .Lock ()
552- defer m .mu .Unlock ()
553- _ , closed := m .closedSessions [sessionID ]
554- return closed
527+ return err
555528}
556529
557530func (m * Manager ) DeleteSession (sessionID string ) error {
0 commit comments