* feat: add DimAgent subscription support
Add OAuth PKCE login with automatic and pasted callbacks, account management, model discovery, quota reporting and gateway integration. Safely rotate credentials during concurrent requests and preserve fresh tokens when updating model caches. Cover protocol, provider, GUI and callback behavior with regression tests.
* dimagent: a refresh hiccup inside the day's lead keeps the token that still runs
The fallback checked !dimagentNearExpiry, which is false whenever a refresh
runs at all, so a 5xx/timeout on /oauth/token failed every request for the
last 24h of a still-valid token. A 401/403 still lapses the account.
* dimagent: review tests (sign forwarding, parallel refresh once, hiccup in lead, LoginUsage)
* dimagent: signing in again takes the callback port from the sign-in it replaces
StartSignIn begins the new flow before it cancels the old one, so the new
flow's listen on 54321 failed (ignored) and the old listener then shut
down a second later: the browser's callback was refused and only pasting
could finish. The older DimAgent flow is now ended and its server closed
first, and the listen retried briefly while the port is let go.
* dimagent: the fake-upstream tests get a name of their own
---------
Co-authored-by: yetone <yetoneful@gmail.com>