Skip to content

Bug: Storage health reports as UNHEALTHY due to async/await issue in v2.3.0 #3

@aaronlippold

Description

@aaronlippold

Bug Description

Version: memcord v2.3.0
Environment: macOS, Claude Code with MCP integration

Issue

The memcord_status command reports storage as UNHEALTHY with the error:

❌ STORAGE: unhealthy
Error: object of type 'coroutine' has no len()

Root Cause

In v2.3.0, the list_memory_slots() function was made async, but several health check functions are calling it without await, resulting in len() being called on a coroutine object.

Affected Functions

  • _check_storage_health() in status_monitoring.py calls list_memory_slots() without await
  • run_health_checks() calls _check_storage_health() without await
  • generate_system_report() calls run_health_checks() without await

Impact

  • Storage health incorrectly reports as UNHEALTHY
  • Diagnostics fail with coroutine errors
  • Core memcord functionality still works (save, read, list)

Steps to Reproduce

  1. Install memcord v2.3.0
  2. Run /memcord-status or /memcord-diagnostics
  3. Observe storage health shows as unhealthy with coroutine error

Expected Behavior

Storage health should report as HEALTHY when memory slots are accessible.

Suggested Fix

Add missing await statements and make health check functions async where needed:

# In status_monitoring.py
async def _check_storage_health(self) -> HealthStatus:
    slots = await self.storage_manager.list_memory_slots()  # Add await
    
async def run_health_checks(self) -> List[HealthStatus]:
    checks.append(await self._check_storage_health())  # Add await
    
async def generate_system_report(self, ...) -> Dict[str, Any]:
    "health_checks": [asdict(check) for check in await self.run_health_calls()]  # Add await

Additional Info

This appears to be an oversight where async/await wasn't consistently applied throughout the health monitoring system in the v2.3.0 refactor.

Thanks for the excellent work on memcord - it's an incredibly valuable tool! Happy to help test any fixes.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions