Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
fix: When the AGFS backend is s3, the error "pyagfs.exceptions.AGFSClientError: parent directory does not exist" occurs. (#254)
baojun-zhang66fdea27af6b
diff --git a/third_party/agfs/agfs-server/pkg/plugins/s3fs/client.go b/third_party/agfs/agfs-server/pkg/plugins/s3fs/client.goindex ca649542a..6b4c141fe 100644--- a/third_party/agfs/agfs-server/pkg/plugins/s3fs/client.go+++ b/third_party/agfs/agfs-server/pkg/plugins/s3fs/client.go@@ -393,12 +393,24 @@ func (c *S3Client) ObjectExists(ctx context.Context, path string) (bool, error)// DirectoryExists checks if a directory exists (has objects with the prefix)// Optimized to use a single ListObjectsV2 callfunc (c *S3Client) DirectoryExists(ctx context.Context, path string) (bool, error) {- prefix := c.buildKey(path)- if prefix != "" && !strings.HasSuffix(prefix, "/") {- prefix += "/"+ // First check if directory marker exists+ dirKey := c.buildKey(path)+ if !strings.HasSuffix(dirKey, "/") {+ dirKey += "/"}-- // Single ListObjectsV2 call to check both directory marker and children++ // Try HeadObject to check if directory marker exists+ _, err := c.client.HeadObject(ctx, &s3.HeadObjectInput{+ Bucket: aws.String(c.bucket),+ Key: aws.String(dirKey),+ })+ if err == nil {+ // Directory marker exists+ return true, nil+ }++ // If directory marker doesn't exist, check if there are any objects with this prefix+ prefix := dirKeyresult, err := c.client.ListObjectsV2(ctx, &s3.ListObjectsV2Input{Bucket: aws.String(c.bucket),Prefix: aws.String(prefix),