mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-01-28 16:38:17 -05:00
fix(workspace): add trailing slash to session path prefix
Prevents session path prefix collisions where "/sessions/abc" could incorrectly match "/sessions/abc123" when using startswith filtering. Now uses "/sessions/abc/" to ensure exact session boundary matching. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -102,8 +102,9 @@ class WorkspaceManager:
|
||||
# Resolve the provided path with session scoping
|
||||
return self._resolve_path(path)
|
||||
elif self.session_path:
|
||||
# Default to session folder
|
||||
return self.session_path
|
||||
# Default to session folder with trailing slash to prevent prefix collisions
|
||||
# e.g., "/sessions/abc" should not match "/sessions/abc123"
|
||||
return self.session_path.rstrip("/") + "/"
|
||||
else:
|
||||
# No session context, use path as-is
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user