Repository navigation
fix(storage): Files not creating in correct folder - #537
Merged
aiosfoundation merged 2 commits intoApr 13, 2026
Merged
aiosfoundation merged 2 commits into
aiosfoundation merged 2 commits into
Conversation
…iders added documentation in docs/
aiosfoundation
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: resolve storage file creation writing to wrong directory
Problem
When an agent requests file creation through the AIOS storage system (e.g.,
create_filewithfile_path="hello_world.txt"), the file is created in the repository root (AIOS/) instead of the configured storage root (AIOS/root/).Root Cause
Two issues in
aios/storage/filesystem/lsfs.py:Positional argument mismatch in
address_request(): Thecreate_filebranch calledself.sto_create_file(file_path, collection_name)positionally, but the method signature issto_create_file(self, file_name, file_path, collection_name=None). This causedfile_pathto be interpreted asfile_nameand the agent name to be interpreted asfile_path.Relative paths not resolved against
root_dir: Even after fixing the argument order,sto_create_file,sto_create_directory, andsto_writeonly prependself.root_dirwhenfile_path is None. When an agent provides a relative path like"hello_world.txt", it was used as-is — creating the file relative to the process working directory instead of underroot/.Changes
File:
aios/storage/filesystem/lsfs.pyaddress_request()— switched thecreate_filebranch from positional args to keyword args (file_name=,file_path=,collection_name=), consistent with all other operation branches. Also extractsfile_namefrom params.sto_create_file()— addedelif not os.path.isabs(file_path)to join relative paths withself.root_dir.sto_create_directory()— same relative path fix.sto_write()— same relative path fix.Before / After
create_file(file_path="hello.txt")AIOS/hello.txtAIOS/root/hello.txtcreate_file(file_path="/tmp/hello.txt")/tmp/hello.txt/tmp/hello.txt(absolute paths unchanged)write(file_path="notes.txt", ...)AIOS/notes.txtAIOS/root/notes.txtDocumentation
No documentation changes required. This is a bugfix to internal storage path resolution logic with no API surface changes.
Testing
Verified manually by running the AIOS kernel and requesting file creation — files now land in
AIOS/root/as expected.