Files
magpie/internal/provider/qoder_free_view_min_test.go
T
yetone 8f5f2a2941 provider: Qoder's mover min is 0.2.52, which renews a job token whose model list is only the free models
star21321321124_93024 (Discord #general, 2026-11-01): a Qoder CN account
with all its credits left listed one model, the free Flash ("Qoder CN: 1
model"), and its agents saw only that one. Qoder CN's model list answers
a caller it doesn't take for the account with every paid model
enable:false and the free one on (captured from gateway.qoder.com.cn,
kept in the plugin's testdata). Up to 0.2.51 the plugin renewed the job
token for such a miss on a chat (plugins#484) but read the list magpie
shows as it came. 0.2.52 renews once from the list too, and doesn't
renew again for a renewed token that still lists only the free models.
keepMovedCurrent brings every moved user up to it.

TestQoderMoverHasTheFreeViewRenewal checks both the qoder and qoder-cn
movers; it fails at 0.2.51 (run).

npm: `npm view @magpie-community/opencode-qoder-auth version
--prefer-online` = 0.2.52 at this commit (registry.npmjs.org, from mote;
this machine's npmmirror still said 0.2.51).

Run at this tree (origin/main b1fc43540 + this change), on mote:
`go test -count=1 -timeout 45m ./internal/provider`: ok (103s).
`gofmt -l internal/provider`: nothing.

Not tried: a real Qoder CN account (none here); whether a renewal gives
the reporter's account its full list back is not confirmed.
2026-11-01 12:52:19 +08:00

21 lines
780 B
Go

package provider
import (
"testing"
"github.com/yetone/magpie/internal/update"
)
// Qoder's plugin before 0.2.52 read a model list with every paid model off
// and the free ones on, what Qoder CN answers a job token it doesn't take
// for the account, as it came: a Qoder CN account showed the free Flash
// alone, and so did its agents. 0.2.52 renews the token once and reads the
// list again. The mover keeps every moved user on a version that does.
func TestQoderMoverHasTheFreeViewRenewal(t *testing.T) {
for _, id := range []string{"qoder", QoderCNID} {
if update.Newer("0.2.52", movers[id].min) {
t.Fatalf("the %s mover installs opencode-qoder-auth %s, which lists only the free models on a job token Qoder no longer takes in full", id, movers[id].min)
}
}
}