/agent: preserve session ID when switching agents
This commit is contained in:
parent
82df12e293
commit
5099ccf51d
|
|
@ -206,8 +206,7 @@ func (s *agent) handleCommand(ctx context.Context, input string, handler EventHa
|
|||
return
|
||||
}
|
||||
d := s.newDispatcher()
|
||||
newSessID := NewSessionID()
|
||||
env := BuildAgentEnv(cfg, d, s.cwd, []string{"OLLIE_SESSION_ID=" + newSessID})
|
||||
env := BuildAgentEnv(cfg, d, s.cwd, []string{"OLLIE_SESSION_ID=" + s.sessionID})
|
||||
if env.Backend != "" {
|
||||
newBe, err := s.newBackend(env.Backend)
|
||||
if err != nil {
|
||||
|
|
@ -230,7 +229,6 @@ func (s *agent) handleCommand(ctx context.Context, input string, handler EventHa
|
|||
s.cfg.MaxSteps = env.maxSteps
|
||||
s.agentName = name
|
||||
s.session = nil
|
||||
s.sessionID = newSessID
|
||||
s.pushSessionEnv()
|
||||
for _, msg := range env.Messages {
|
||||
handler(infoEvent(msg))
|
||||
|
|
|
|||
Reference in New Issue