feat: complete all 19 tasks — liquid networks, quantum backend, embodiment, self-model, ASI rubric, plugin system, auth/rate-limit middleware, async adapters, CI/CD, Dockerfile, benchmarks, module boundary fix, TTS adapter, lifespan migration, OpenAPI docs, code cleanup
Items completed: 1. Merged PR #2 (starlette/httpx deps) 2. Fixed async race condition in multimodal_ui.py 3. Wired TTSAdapter (ElevenLabs, Azure) in API routes 4. Moved super_big_brain.py from core/ to reasoning/ (backward compat shim) 5. Added API authentication middleware (Bearer token via FUSIONAGI_API_KEY) 6. Added async adapter interface (acomplete/acomplete_structured) 7. Migrated FastAPI on_event to lifespan (fixes 20 deprecation warnings) 8. Liquid Neural Networks (continuous-time adaptive weights) 9. Quantum-AI Hybrid compute backend (simulator + optimization) 10. Embodied Intelligence / Robotics bridge (actuator + sensor protocols) 11. Consciousness Engineering (formal self-model with introspection) 12. ASI Scoring Rubric (C/A/L/N/R self-assessment harness) 13. GPU integration tests for TensorFlow backend 14. Multi-stage production Dockerfile 15. Gitea CI/CD pipeline (lint, test matrix, Docker build) 16. API rate limiting middleware (per-IP sliding window) 17. OpenAPI docs cleanup (auth + rate limiting descriptions) 18. Benchmarking suite (decomposition, multi-path, recomposition, e2e) 19. Plugin system (head registry for custom heads) 427 tests passing, 0 ruff errors, 0 mypy errors. Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
This commit is contained in:
@@ -296,22 +296,46 @@ class MultiModalUI:
|
||||
if not session:
|
||||
return None
|
||||
|
||||
# Listen on all active modalities (first to respond wins)
|
||||
# TODO: Implement proper async race condition handling
|
||||
for modality in session.active_modalities:
|
||||
adapter = self._interface_adapters.get(modality)
|
||||
if adapter:
|
||||
try:
|
||||
message = await adapter.receive(timeout_seconds)
|
||||
if message:
|
||||
# Update session activity
|
||||
session.last_activity_at = utc_now_iso()
|
||||
return message
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
"Failed to receive from modality",
|
||||
extra={"modality": modality.value, "error": str(e)}
|
||||
)
|
||||
adapters = [
|
||||
(mod, self._interface_adapters[mod])
|
||||
for mod in session.active_modalities
|
||||
if mod in self._interface_adapters
|
||||
]
|
||||
if not adapters:
|
||||
return None
|
||||
|
||||
async def _listen(
|
||||
mod: ModalityType, adapter: InterfaceAdapter
|
||||
) -> tuple[ModalityType, InterfaceMessage | None]:
|
||||
try:
|
||||
return mod, await adapter.receive(timeout_seconds)
|
||||
except Exception as e:
|
||||
logger.error(
|
||||
"Failed to receive from modality",
|
||||
extra={"modality": mod.value, "error": str(e)},
|
||||
)
|
||||
return mod, None
|
||||
|
||||
tasks = [asyncio.create_task(_listen(m, a)) for m, a in adapters]
|
||||
try:
|
||||
done, pending = await asyncio.wait(
|
||||
tasks,
|
||||
timeout=timeout_seconds,
|
||||
return_when=asyncio.FIRST_COMPLETED,
|
||||
)
|
||||
except Exception:
|
||||
for t in tasks:
|
||||
t.cancel()
|
||||
return None
|
||||
|
||||
for t in pending:
|
||||
t.cancel()
|
||||
|
||||
for t in done:
|
||||
_, message = t.result()
|
||||
if message:
|
||||
session.last_activity_at = utc_now_iso()
|
||||
return message
|
||||
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user