38233a569c0ef63e6bdf897534a9257d49451c1f
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
bf47b85b56 |
qoder 0.2.71: a queue with nothing ahead that hasn't moved in 5 minutes ends with its 503 (#1220)
nsyan's Qoder CN account answered 10605 in ~190ms with
{queueCount: 1, queueType: p4, subCode: RESOURCE_LIMIT,
retryAfterSeconds: 60}, and queue/status gave the same bytes back at every
ask. The 120s silent watchdog (#1204) doesn't cover a call that answered,
so a streamed request was held for QUEUE.held (an hour) and the agent
heard keepalives only until it cancelled.
- queueWait ends the wait when nothing is ahead of the request
(queueCount 1 or none) and the state (isQueued, serviceAvailable,
queueCount, queueType, subCode, retryAfterSeconds) has been the same at
every ask for QUEUE.stuck (5 minutes). The stream's error is the
queue's 503 with Retry-After, plus "the queue hasn't moved in 5 minutes
with nothing ahead".
- A queue with others ahead is still waited out as Qoder's client waits
it (#807), changed or not; a state that changes resets the clock.
- queueState also reads queueCount and subCode.
Run (mica, HOME=$(mktemp -d); mote was at load 36):
- bun test packages/qoder: 450 pass, 0 fail.
- bun scripts/check.mjs qoder: ok.
Broken by hand: origin/main's index.mjs with the new tests: the 5-minute
cutoff test fails (19 pass, 1 fail); the two no-regression tests pass on
both.
Not tried: a real Qoder CN account in a frozen queue (none here); the
fixture is the reporter's literal state.
|
||
|
|
1975c937d6 |
qoder: a streamed request Qoder queues waits up to Qoder's hour, kept alive with comments (#807)
When Qoder queued a request (10605), the plugin waited at most 4 minutes
and then answered 503. Codex retried it, so the user saw the turn stop
and start again while Qoder's own client would have waited up to an hour.
The 4 minutes were there because nothing reached the agent during the
wait.
Now a streamed request with no fallback is answered 200 at once. The
first SSE comment says the queue, and another comment follows every 10s
(QUEUE.beat) while the plugin waits up to QUEUE.held (1h) from the start.
magpie counts each upstream comment as the reply going on: it tells a
Codex client response.in_progress (the event Codex's 300s idle timeout
counts), and its 30-minute translated-silence watch restarts with each
comment. The result goes in the same stream: the answer, or the refusal
as `data: {"error":{message, code}}` (the queue's 503 after the hour, a
113's 429). Cancelling the stream aborts the status ask in flight and
stops the beat. A request that isn't streamed, or that carries
x-magpie-fallback, keeps the 4-minute wait and 503 it had. No setting was
added.
Run on mote: packages/qoder `bun test` (396 pass), `bun scripts/check.mjs
qoder` (ok), and the repo's `HOME=$(mktemp -d) bun test` as CI runs it
(6503 pass, 0 fail).
(Without the temp HOME, devin and zcode's guards refuse to run, as
designed.) queue.test.mjs runs a fake clock and timers: pauses and beats
move the clock, and no test waits on wall time.
Broken by hand, each red, then restored:
- no hold (streamed waits 4 min, as before): 4 red
- no beat timer: the 20-minute test red
- held stream's signal not linked to the status asks: the cancel test red
- held set to 4 min: the 20-minute and the hour tests red
Not tried: a real account that Qoder queues. I have none, so the
stream's shape was checked against magpie's gateway in a test on the
magpie side. A relogin during a held stream loses the "renewed" sign-in
mark, because the headers are already sent. Claude Code counts only 30
pings in a row as alive, about 35 minutes, so a longer wait still ends
there.
Reported-by: real-jacket
|
||
|
|
bc25bc5077 |
qoder 0.2.40: a queued request gives way at once when magpie has another candidate
axuhere on X sat at "模型请求正在排队 · 预计等待超过 10 分钟" on a free
model while another provider could have answered. Through magpie, a
Qoder free model queued with 10605 was waited out for up to 4 minutes
even when the request had another account, provider or routing group
member after it.
magpie now sends x-magpie-fallback: 1 on a plugin request that isn't
the last candidate (the host keeps it from the vendor). Told so, a
queued request isn't waited out: the 503 with Qoder's Retry-After comes
at once, and magpie asks the next. The message now also says how many
are ahead when Qoder says it ("Qoder queued the request for dfmodel
(this plan's queue: p3, 3 ahead); try again in 30s"). Without the
header, the wait is as before.
Run: packages/qoder `bun test` (268 pass, 22 files); `bun
scripts/check.mjs` all green.
Broken by hand: index.mjs as before with the new tests: the fallback
test and the budget test's message red (2 of 12 in queue.test.mjs).
Not tried: a real Qoder account queued live; the 10605 shape is
testdata/queued-10605.json's, captured before.
|
||
|
|
a379c54b17 |
qoder 0.2.39: a queued call's stream is closed, and its resend is a new request in the same set (#427)
Peterpig (#427, qoder.com, personal_standard, magpie 0.1.1709, plugin
0.2.38): both free models, qfmodel and dfmodel, fail every test with
"context deadline exceeded". Reproduced with the owner's real qoder.com
account and the plugin driven straight from bun (sandbox HOME, its live
token unrenewed): the free models are queued intermittently with
10605 {"isQueued":true,"queueType":"p3","subCode":"RESOURCE_LIMIT",
"serviceAvailable":false,"retryAfterSeconds":30,"waitTime":30}. A
status ask 30s later says isQueued false, the resend is sometimes queued
again, and the answer comes 38s to 71s after the request. magpie's test
waits 20s, so a queued free model is "context deadline exceeded" there
whatever the plugin does; that is Qoder's queue, not the network.
Two things the plugin did differently from Qoder's client
(qoder-agent-sdk worker in Qoder.app 0.4.3, the [ModelQueue] path):
- Qoder keeps a 10605 stream open after its one event. The plugin read
that event and left the stream open through the wait and the resend
(seen held to the 170s abort on the real account). The refused call's
fetch now has its own AbortController, aborted once the call is read
as refused.
- The client gives every resend a new request_id and chat_record_id
(o4i) under the same request_set_id, and asks the queue with the
latest request_id. The plugin sent the same request_id again. It now
does as the client does. Not shown to matter: with the old code a
resend was answered once and queued again in other runs, as with the
new code, so the queue looks load-driven either way.
Run at this tree (base
|
||
|
|
26ddabe4de |
qoder 0.2.28: a queued request waits its turn in Qoder's queue and is sent again, as Qoder's client does (wallance on Discord)
wallance (Discord, magpie latest, qoder 0.2.27): Qoder's free deepseek
flash (dfmodel) through magpie ended in 503 "Qoder queued the request for
dfmodel (this plan's queue: p3); try again in 30s" after 27s, while Qoder's
own client answered the same model, slowly. magpie's gateway retries a
Retry-After of 8s at most, so the 30s was the agent's error.
What Qoder's client does, read from Qoder.app 0.4.3's
qoder-agent-sdk/dist/_worker/qoder-worker-runtime.obf.mjs ("[ModelQueue]"):
on a 10605 or a queue state it asks
GET <api>/algo/api/v2/service/ask/queue/status?requestSetId=&modelKey=&queueType=
(signed as any GET, X-Request-ID and X-Session-ID), at once and then every
retryAfterSeconds held to 0.5..30s (30s unsaid), while isQueued is true or
serviceAvailable false. Once isQueued is false it waits that state's
retryAfterSeconds and sends the same chatAsk again (same request_set_id),
up to 10 times; 3 failed status asks in a row, a 404 or a state with
neither field end it. It waits up to an hour (QODER_MODEL_QUEUE_MAX_WAIT_MS),
and tells /api/v2/service/ask/finish at the end of its turn, best effort
("server TTL will release the lease").
The plugin now does that, under a 4-minute budget from the request's
start: nothing reaches the agent meanwhile, and magpie keeps a stream's
agent alive with SSE comments for 5 minutes of silence (keepQuiet,
keepaliveLongest). Past it, the 503 with Retry-After as before, so magpie
may ask another account. A cancelled request stops the wait and sends
nothing more. The status path's /algo prefix follows the client's other
paths (it signs "/api/v2/model/list", the plugin calls
"/algo/api/v2/model/list").
Run: HOME=$(mktemp -d) bun test in packages/qoder, 185 pass; at the repo
root, 2114 pass, 0 fail, at
|