Skip to content

[Bug] Storage syscall ValidationError when response_message is empty list #515

@younghosck

Description

@younghosck

Checked other resources

  • I added a very descriptive title to this issue.
  • I am sure the issue hasn't been already addressed by searching through https://github.com/agiresearch/AIOS/issues.
  • The usage issue is not resolved by updating to the latest stable version in the main branch.

Describe your current environment

Environment

System:

  • OS: macOS (MacBook Pro 14)
  • Python version: 3.11

AIOS Configuration:

  • AIOS Version: [specify version, e.g., v0.2.2]
  • LLM Model: qwen2.5:7b (via Ollama)
  • Backend: Ollama

Reproduction Environment:

  • Local machine setup
  • Running AIOS kernel locally
  • Using local LLM inference

Describe the bug

Description

When executing a storage syscall, the system crashes with a Pydantic ValidationError because response_message is being set to an empty list [] instead of a string. This causes the entire AIOS system to fail and requires a restart.

Error Message

ValidationError: 1 validation error for StorageResponse
response_message
Input should be a valid string [type=string_type, input_value=[], input_type=list]
For further information visit https://errors.pydantic.dev/2.7/v/string_type

2025-11-12 17:16:36,842 - aios.scheduler.fifo_scheduler - ERROR - Error executing Storage syscall: 1 validation error for StorageResponse
response_message
Input should be a valid string [type=string_type, input_value=[], input_type=list]
For further information visit https://errors.pydantic.dev/2.7/v/string_type
Traceback (most recent call last):
File "/Users/macbookpro14/Documents/aios/AIOS/aios/scheduler/fifo_scheduler.py", line 134, in _execute_syscall
response = executor(syscall)
^^^^^^^^^^^^^^^^^
File "/Users/macbookpro14/Documents/aios/AIOS/aios/storage/storage.py", line 26, in address_request
return StorageResponse(
^^^^^^^^^^^^^^^^
File "/Users/macbookpro14/.pyenv/versions/aios-dev/lib/python3.11/site-packages/pydantic/main.py", line 175, in init
self.pydantic_validator.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for StorageResponse
response_message
Input should be a valid string [type=string_type, input_value=[], input_type=list]
For further information visit https://errors.pydantic.dev/2.7/v/string_type

Image

Current Issue:
The StorageResponse expects response_message to be a string, but sometimes it receives an empty list [], causing a ValidationError.

Suggested Fix:
Add the following validation after the storage operation is completed:

# After performing storage operation
result = perform_storage_operation()  # Actual storage operation

# Add validation check here
if not response_message or response_message == []:
    response_message = "Storage operation completed"

return {"response_message": response_message, "finished": True}

Thank you for considering this issue. I'm happy to help with further testing or submit a pull request if you'd like me to implement this fix.

Looking forward to your feedback!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreport bugs that need to be fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions