sherlock (Discord): the same QwenWork account works in ZCode, and dsh's auto-review failed with "QwenWork: usage limit reached: All models failed". "All models failed" is Qoder's own message: nothing in the plugin or magpie builds it. The plugin only put "usage limit reached:" before it, which hid the status, code and reply it came with. The failure now ends with "(Qoder replied HTTP 429, code N: <reply>)" for a 429 or quota-worded reply with no quota code; quota codes keep their short words. The cause of the 429 itself is NOT found. dsh's reviewer sends a system prompt, one user message, temperature 0, no tools and no max_tokens (read from dsh-experimental-auto-review); the plugin sends no temperature and 32000 max_tokens for it. Nothing in qoderBody differs in a way known to fail. This release makes the next report carry Qoder's reply. Run on mote (bun): packages/qoder bun test 385 pass, 0 fail (raw-429.test.mjs new); bun scripts/check.mjs qoder ok. Broken by hand (old failure()): 2 of the 3 new tests fail. Not tried: a real QwenWork account.
26 lines
1.1 KiB
JavaScript
26 lines
1.1 KiB
JavaScript
// A 429 that names no quota carries Qoder's status, code and own reply, so a
|
|
// user sees what Qoder said and not only "usage limit reached"
|
|
// (QwenWork flash through dsh: "All models failed").
|
|
import { test, expect } from "bun:test"
|
|
import { _internal } from "./index.mjs"
|
|
|
|
test("a 429 with no quota in it shows Qoder's status, code and reply", () => {
|
|
const body = JSON.stringify({ code: "9001", message: "All models failed", details: "{\"error\":{\"message\":\"flash: rate limited\"}}" })
|
|
const f = _internal.failure(429, body)
|
|
expect(f.status).toBe(429)
|
|
expect(f.message.startsWith("usage limit reached: All models failed")).toBe(true)
|
|
expect(f.message).toContain("HTTP 429")
|
|
expect(f.message).toContain("code 9001")
|
|
expect(f.message).toContain("flash: rate limited")
|
|
})
|
|
|
|
test("an empty 429 still says its status", () => {
|
|
const f = _internal.failure(429, "")
|
|
expect(f.status).toBe(429)
|
|
expect(f.message).toContain("HTTP 429")
|
|
})
|
|
|
|
test("a quota code keeps its short words", () => {
|
|
expect(_internal.failure(429, JSON.stringify({ code: "112", message: "credits used up" })).message).toBe("usage limit reached: credits used up")
|
|
})
|