session alignment: force single main session and openclaw-style agents/main/sessions path

This commit is contained in:
DBT
2026-02-26 02:20:51 +00:00
parent 27e805fac0
commit 2d0ca1d4ce
2 changed files with 4 additions and 22 deletions

View File

@@ -75,7 +75,7 @@ func NewAgentLoop(cfg *config.Config, msgBus *bus.MessageBus, provider providers
workspace := cfg.WorkspacePath()
os.MkdirAll(workspace, 0755)
sessionsManager := session.NewSessionManager(filepath.Join(filepath.Dir(cfg.WorkspacePath()), "sessions"))
sessionsManager := session.NewSessionManager(filepath.Join(filepath.Dir(cfg.WorkspacePath()), "agents", "main", "sessions"))
toolsRegistry := tools.NewToolRegistry()
processManager := tools.NewProcessManager(workspace)
@@ -442,6 +442,7 @@ func (al *AgentLoop) GetSessionHistory(sessionKey string) []providers.Message {
}
func (al *AgentLoop) processMessage(ctx context.Context, msg bus.InboundMessage) (string, error) {
msg.SessionKey = "main"
unlock := al.lockSessionRun(msg.SessionKey)
defer unlock()
// Add message preview to log