You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Per-account quota poller (tối ưu phụ — failover ở ticket 3 vẫn là cơ chế chính):
Poll quota mỗi acc (tái dùng code snapshot trong routes-quota.ts) mỗi ~5 phút với jitter (acc không poll cùng lúc), timeout riêng, lastPolledAt per acc.
Poll fail ≠ exhausted: lỗi poll chỉ log + đánh stale, không đổi health.
Tách bạch expiry: tokenExpiresAt (JWT) vs quotaExpiresAt (entitlement) — không gộp.
Poller feed remainingUnits vào pool (cho option most-remaining-quota).
/quota schema cố định — không đổi shape theo số acc:
✅ Poller per-account: single-flight (test maxConcurrent=1), jitter ±20%, timeout riêng (abort + failure count), không chiếm reservation slot (đọc credential trực tiếp từ store), tự bắt đầu/dừng khi thêm/xóa acc (follower, test chứng minh)
✅ Poll fail ≠ exhausted: giữ nguyên trạng thái, chỉ consecutiveFailures++; poll thành công heal expired/exhausted (poller là probe chính)
Activity
longphamdev commentedon Nov 9, 2026
#6 hoàn thành. Commits:
abd519a(poller + /quota schema),6e6b7b6(thiết kế nền),b72e980(auth list).Acceptance theo review:
consecutiveFailures++; poll thành công heal expired/exhausted (poller là probe chính){accounts[], aggregate, legacy}— cùng shape 1 hay 2 acc;legacytheo primary giữ nguyên field cũ; poll fail →legacyStale: true; aggregate ghi rõaccountsReporting/accountsTotal+ unit check;tokenExpiresAt≠quotaExpiresAt; không credential trong response (test assert)auth list: status + quota, userId che bớt, không in keyLưu ý: e2e với 2 acc thật chưa chạy được (acc thứ hai quota rỗng) — sẽ chạy khi có quota. Header
x-zcode-account+ phân phối đã có unit tests.Frontier: #2 (CLI accounts) — worktree t2 đã sync tới HEAD.
longphamdev commentedon Nov 9, 2026
Hoàn thành đầy đủ 6 acceptance criteria. Suite 1222/0 local, 1223/0 container.
feat(auth): AccountPool module — runtime state machine, round-robin, …
feat(quota): per-account poller + fixed /quota multi-account schema (#6)
feat(cli): auth list with status/quota per account (#6)
feat(cli): auth login --add/--label + auth remove (#2)