fix: server.go pathType validates agent by Name not ID

This commit is contained in:
Ollie Agent 2026-08-01 18:02:57 +02:00
parent 19690d0ef5
commit 9acc609db5
1 changed files with 3 additions and 6 deletions

View File

@ -572,12 +572,9 @@ func (s *Server) pathType(path string) string {
if len(parts) == 2 {
return "dir"
}
// Validate agent ID
expectedID := sess.Core.Agent().ID()
if expectedID == "" {
expectedID = "0"
}
if parts[2] != expectedID {
// Validate agent Name
agentName := sess.Core.Agent().Name()
if agentName == "" || parts[2] != agentName {
return ""
}
// /session/{id}/agent/{aid} — directory