Files
plugins/packages/qoder/package.json
T
yetone 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
2026-11-07 02:20:31 +08:00

31 lines
773 B
JSON

{
"name": "@magpie-community/opencode-qoder-auth",
"version": "0.2.62",
"description": "Qoder and QwenWork (千问办公) subscriptions in OpenCode and magpie: qoder.com, qoder.cn, gateway.qwenwork.cn and the enterprise flagship, VPC and dedicated domains",
"type": "module",
"main": "./opencode.mjs",
"exports": { ".": "./opencode2.mjs" },
"files": [
"index.mjs",
"opencode.mjs",
"opencode2.mjs",
"README.md",
"LICENSE-CLIProxyAPI"
],
"keywords": [
"opencode",
"opencode-plugin",
"magpie",
"qoder",
"qoder-cn",
"qwenwork",
"千问办公"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/magpie-community/plugins.git",
"directory": "packages/qoder"
}
}