Files
plugins/packages
yetone 01acd0951c minimax 0.1.1: a refresh token is never sent twice, and magpie renews the sign-in ahead of time through auth.refresh (ARNO on Discord: minimax插件的登录状态容易掉登陆,几个小时就提示要重新登陆了)
MiniMax spends a refresh token once: sent again it is invalid_grant, which
signs the account out (MiniMax Code takes a lock across its processes and
keeps a generation for it). The plugin's refresh request is MiniMax Code's
own, so what drops the account is a refresh token spent a second time:

- auth.refresh + refreshLead (10 minutes): magpie renews the account once,
  before its requests, models and usage ask for it. The 2-minute check
  before each request stays for OpenCode.
- A refresh whose save failed kept its tokens a minute, then went back to
  the spent refresh token on disk. They are kept now until saved, and
  latest() follows them.
- invalid_grant when the store holds a newer refresh token than the one
  spent (another magpie process renewed it) uses that one, not a sign-out.
- A 401 retries with a newer saved token when there is one, and refreshes
  only when the token turned away is still the newest.

Five tests in refresh.test.mjs, all failing on 0.1.0. HOME=$(mktemp -d) bun test: 353 pass.
2026-10-03 11:39:06 +08:00
..