Mission-Control/src/backend/app
Ripley d09822a821 feat: add gateway data collection service + fix model FK definitions
- Created src/backend/app/services/monitoring/ package:
  - gateway_collector.py: Background asyncio task that polls gateway RPC endpoints
    (usage.cost, usage.status, cron.list, sessions.list/preview, health, status)
    and stores results in monitoring models using upsert pattern
  - models.py: Pydantic schemas for parsing gateway RPC responses
  - __init__.py: Package init, exports GatewayCollectorService

- Added collector startup/shutdown in main.py lifespan:
  - Launches collector as background task when gateways exist
  - Clean shutdown on app termination

- Fixed model FK definitions in monitoring.py and alert_rules.py:
  - Replaced Column(UUID, ForeignKey(...)) with Field(foreign_key=...)
    to match codebase pattern (UUID is Python class, not SQLAlchemy type)
  - Added missing gateway_id field to AlertRule model
  - Removed OpenClawDBService inheritance from GatewayCollectorService
    (uses session factory pattern instead of injected session)
  - Cleaned up duplicate/conflicting imports

- Configurable collection intervals via env vars:
  COLLECTION_INTERVAL_COST (300s), COLLECTION_INTERVAL_CRON (60s),
  COLLECTION_INTERVAL_SESSION (30s), COLLECTION_INTERVAL_HEALTH (60s)
2026-05-10 20:13:16 -05:00
..
api feat: initial project setup - base platform forked and running 2026-05-10 11:14:55 -05:00
core feat: initial project setup - base platform forked and running 2026-05-10 11:14:55 -05:00
db feat: initial project setup - base platform forked and running 2026-05-10 11:14:55 -05:00
models feat: add gateway data collection service + fix model FK definitions 2026-05-10 20:13:16 -05:00
schemas feat: initial project setup - base platform forked and running 2026-05-10 11:14:55 -05:00
services feat: add gateway data collection service + fix model FK definitions 2026-05-10 20:13:16 -05:00
__init__.py feat: initial project setup - base platform forked and running 2026-05-10 11:14:55 -05:00
main.py feat: add gateway data collection service + fix model FK definitions 2026-05-10 20:13:16 -05:00