qoder 0.2.60: the business record names the model (plugins#692, #638)
Qoder and Qoder CN booked every call as Auto whatever model_config named (chansee97, #692; square-235 on #638 after 0.2.54's model_config change did not help). The reference PR shuishuipingan/qoder2api-hub#119 says the official CLI's business block carries model_key. Checked in the client itself: @qoder-ai/qodercli 1.1.82 (npm pack, read only) builds the record in qoder-worker-runtime (v3 -> snn, then {..., model_key: <chosen model>}) and keeps it for the prompt. Qoder.app 0.4.3 and QwenWorkCN.app 1.0.46 on this Mac build theirs without it, so QwenWork's site says businessModelKey: false and is unchanged. qoderBody now adds business.model_key = the call's model key for qoder and qoder-cn. Run (mote): bun test packages/qoder, 388 pass. With the old index.mjs put back, the 6 new tests fail (business.model_key missing). bun scripts/check.mjs qoder. Not tried: a real Qoder or Qoder CN account, so the billing change is not confirmed; the attribution claim rests on the client's code and the PR's capture.
This commit is contained in:
@@ -170,7 +170,7 @@ test("the plan and the resource pack read as Qoder's own panel does, with counts
|
||||
expect(u.plan).toBe("personal_professional")
|
||||
expect(u.until).toBe("2026-11-21T16:00:00.000Z")
|
||||
expect(u.windows).toEqual([
|
||||
{ name: "Total credits", used: (100 * 4217) / 5400, display: "4217 / 5400 credits", amount: 4217, limit: 5400, unit: "credits" },
|
||||
{ name: "Total credits", used: (100 * 4217) / 5400, display: "4217 / 5400 credits", amount: 4217, limit: 5400, unit: "credits", resetsAt: "2026-11-21T16:00:00.000Z" },
|
||||
{ name: "Credits", used: (100 * 1817) / 2000, display: "1817 / 2000 credits", amount: 1817, limit: 2000, unit: "credits", aside: true, resetsAt: "2026-11-21T16:00:00.000Z" },
|
||||
{ name: "Add-on credits", used: (100 * 2400) / 3400, display: "2400 / 3400 credits", amount: 2400, limit: 3400, unit: "credits", aside: true },
|
||||
])
|
||||
@@ -610,3 +610,18 @@ test("usage's user is the card's name, and the accountId stays the identity (rev
|
||||
expect(u.user).toBe("138****8000")
|
||||
expect(auth.accountId).toBe("one@x")
|
||||
})
|
||||
|
||||
test("the total renews with the plan's credits, so routing sees the reset (@tnt12231 on X)", () => {
|
||||
// a Teams account: plan credits 2,336 / 3,000 renewing tomorrow, shared 0 / 1,000
|
||||
const u = _internal.parseUsage({
|
||||
displayMode: "qoder",
|
||||
qoderUsage: {
|
||||
userType: "teams",
|
||||
expiresAt: "2026-11-13T05:04:00.000Z",
|
||||
userQuota: { total: 3000, used: 2336, remaining: 664, unit: "credits" },
|
||||
orgResourcePackage: { total: 1000, used: 0, remaining: 1000, unit: "credits" },
|
||||
},
|
||||
})
|
||||
const counted = u.windows.filter((w) => !w.aside)
|
||||
expect(counted.map((w) => [w.name, w.resetsAt])).toEqual([["Total credits", "2026-11-13T05:04:00.000Z"]])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user