Bug
All CLI sync commands fail with "Unknown community" for every community because src/cli/sync.py imports registry but never calls discover_assistants(). The registry is empty when CLI sync commands run.
$ osa sync github --community hed
Error: Unknown community 'hed'
Available communities:
Root Cause
sync.py imports from src.assistants import registry at module level, but discover_assistants() is never called -- neither in sync.py nor in main.py. The API server calls it at startup via lifespan, but the CLI path doesn't.
Fix
Add a @sync_app.callback() that calls discover_assistants() before any sync command runs:
@sync_app.callback()
def sync_callback() -> None:
"""Ensure assistants are discovered before sync commands."""
from src.assistants import discover_assistants
discover_assistants()
Workaround
Trigger syncs directly via Python instead of CLI:
docker exec osa python -c "
from src.assistants import discover_assistants; discover_assistants()
from src.knowledge.github_sync import sync_repos
sync_repos('hed')
"
Introduced in
PR #218 (Release 0.7.0) -- the CLI refactor moved sync commands to a separate module without ensuring discovery runs.
Bug
All CLI sync commands fail with "Unknown community" for every community because
src/cli/sync.pyimportsregistrybut never callsdiscover_assistants(). The registry is empty when CLI sync commands run.Root Cause
sync.pyimportsfrom src.assistants import registryat module level, butdiscover_assistants()is never called -- neither insync.pynor inmain.py. The API server calls it at startup vialifespan, but the CLI path doesn't.Fix
Add a
@sync_app.callback()that callsdiscover_assistants()before any sync command runs:Workaround
Trigger syncs directly via Python instead of CLI:
Introduced in
PR #218 (Release 0.7.0) -- the CLI refactor moved sync commands to a separate module without ensuring discovery runs.