#1 URL-Encode Aliases CRITICAL
resolve_room_alias must encode # and : chars. Without encoding, all alias lookups fail.
#2 Catch 409 Specifically HIGH
Race condition handler catches only HTTPStatusError with 409, not bare Exception.
#3 Thread-Safe Cache HIGH
Agent cache uses threading.Lock + TTL eviction (1h). Prevents RuntimeError on concurrent access.
#4 Sync Filter MEDIUM
Ad-hoc filter on /sync reduces payload ~60%. Only receives message, state, and member events.
#5 Startup Jitter MEDIUM
Ephemeral agents sleep random 0-2s before Space operations. Prevents 429 storms on mass boot.
#6 Graceful Degradation MEDIUM
Agent boots and operates even if Space is unavailable. Sets space_id=None, runs in v1 mode.
#7 Rate Limit (429) MEDIUM
_request wrapper retries with retry_after_ms from response body. 3 attempts max.
#8 list_agents Edge Cases MEDIUM
Skip rooms returning 403, missing state, or empty via field. Never crash on inaccessible rooms.