zhi
1c062ff4f1
BE-CAL-003: Add Agent model with status/heartbeat/exhausted fields
- New app/models/agent.py with Agent model, AgentStatus & ExhaustReason enums
- Agent has 1-to-1 FK to User, unique agent_id (OpenClaw $AGENT_ID),
claw_identifier (OpenClaw instance, convention-matches MonitoredServer.identifier)
- Status fields: status (idle/on_call/busy/exhausted/offline), last_heartbeat
- Exhausted tracking: exhausted_at, recovery_at, exhaust_reason (rate_limit/billing)
- User model: added 'agent' back-reference (uselist=False)
- Schemas: AgentResponse, AgentStatusUpdate, UserCreate now accepts agent_id+claw_identifier
- UserResponse: includes agent_id when agent is bound
- Users router: create_user creates Agent record when agent_id+claw_identifier provided
- Auto-migration: CREATE TABLE agents in _migrate_schema()
- Startup imports: agent and calendar models registered
2026-03-30 20:47:44 +00:00
..
2026-02-21 08:25:37 +00:00
2026-03-16 13:22:14 +00:00
2026-03-30 20:47:44 +00:00
2026-02-22 09:05:05 +00:00
2026-03-30 19:16:16 +00:00
2026-03-29 16:33:00 +00:00
2026-03-21 19:18:20 +00:00
2026-03-19 09:38:37 +00:00
2026-03-30 20:47:44 +00:00
2026-03-20 10:03:56 +00:00
2026-03-16 13:22:14 +00:00
2026-03-30 12:49:52 +00:00
2026-03-29 15:35:23 +00:00
2026-03-12 11:41:55 +00:00
2026-03-19 09:38:37 +00:00
2026-03-30 10:46:20 +00:00
2026-03-16 13:22:14 +00:00
2026-03-16 13:22:14 +00:00