Two fixes from CodeRabbit review: - Add MAX_AGENT_LOG_BACKLOG cap (5000 entries) to prevent unbounded memory growth during prolonged SQLite outages. Oldest entries are dropped when cap is exceeded. - Only assign this._db/this._archiveDb after init() succeeds. On failure, close the DB handle before throwing so callers never get a partially initialized instance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>