Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce), factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own code says the vendor refuses a spent refresh token. magpie then stops carrying these sign-ins to another computer through Sync, a backup or a Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh keeps the old token when the answer has none, and there is no evidence it rotates. Each package's patch version is bumped (cline 0.1.15, codearts 0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova 0.2.3, workbuddy 0.2.30). Each was checked against npm, or against origin/dist for the dist-only packages, before the merge. Fixes #884. Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME: bun test over the eight packages gave 1588 pass, 0 fail, and scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4, mote gave 1834 pass with Trae included. Not tried: a real refresh against each vendor. Co-authored-by: yetihan <yetihan@users.noreply.github.com>
This commit is contained in:
@@ -3249,6 +3249,7 @@ export const CodeArtsAuthPlugin = async ({ client } = {}, options = {}) => {
|
||||
auth: {
|
||||
provider: PROVIDER,
|
||||
refreshLead: REFRESH_LEAD_MS,
|
||||
rotating: true,
|
||||
// The gateway's own cap: more in flight only queues in the plugin.
|
||||
maxConcurrency: maxInflight,
|
||||
|
||||
@@ -4639,6 +4640,7 @@ export const OfficeAceAuthPlugin = async ({ client } = {}, options = {}) => {
|
||||
icon: OFFICEACE_ICON,
|
||||
maxConcurrency: 3,
|
||||
refreshLead: OA_REFRESH_LEAD_MS,
|
||||
rotating: true,
|
||||
|
||||
methods: [
|
||||
{
|
||||
|
||||
@@ -3824,11 +3824,13 @@ test("a renewal never invalidates the other card's record", async () => {
|
||||
oa.refreshLineages.clear()
|
||||
|
||||
const ca2 = await CodeArtsAuthPlugin({ client }, { fetch: ca.fetcher, ledgerPath })
|
||||
assert.equal(ca2.auth.rotating, true)
|
||||
const renewed = await ca2.auth.refresh(store.get(codeartsKey))
|
||||
assert.equal(accessOf(renewed), "AK-1CA")
|
||||
|
||||
// ... and the other card's record still renews with its own token
|
||||
const of = await OfficeAceAuthPlugin({ client }, { fetch: oaSts.fetcher, ledgerPath })
|
||||
assert.equal(of.auth.rotating, true)
|
||||
const again = await of.auth.refresh(store.get(officeaceKey))
|
||||
assert.equal(accessOf(again), "AK-1OA")
|
||||
})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@magpie-community/opencode-codearts-auth",
|
||||
"version": "0.3.12",
|
||||
"version": "0.3.13",
|
||||
"description": "Huawei Cloud in OpenCode and magpie: CodeArts (码道) and OfficeAce (AgentArts), each from its own Huawei Cloud OAuth sign-in — models, credit rates, credit usage and the daily check-in (unofficial)",
|
||||
"type": "module",
|
||||
"main": "./opencode.mjs",
|
||||
|
||||
Reference in New Issue
Block a user