38594b5aee37c9828dcb32a93155eb9048720bbf
89
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.
|
||
|
|
0c685fe902 |
qoder 0.2.70: a call Qoder sends nothing to for 120s is dropped with a 504 that says so (#1204)
xiaotao6869 (#1204): a non-streamed Qoder CN call got no bytes for 15 minutes, and magpie serve logged only the client's 499 after 60s. Nothing bounded the chat fetch or its first event, so a call Qoder held open with nothing sent waited for as long as the client did, and no line said where. The chat call now has QUEUE.silent (120s) to get its reply headers and first event. Past that the call is aborted and answers 504 "<site> sent nothing for 120s after the request (no reply headers | no first event); the call was dropped", with no sign-in verdict, so the gateway can fail over and the log names the stage. A queued call answers its 10605 at once and a thinking model streams reasoning first, so a real answer starts well inside it; the timer ends once the first event is read, and a long answer is not cut. Run (mica, temp HOME): bun test in packages/qoder 447 pass, 0 fail; bun scripts/check.mjs qoder ok. Broken by hand: origin/main's index.mjs with silent.test.mjs: the three silent cases hang to bun's 3s test timeout, the answered case passes. Not tried: a real Qoder CN account; the cause of the reporter's silent 15 minutes is not known, this only bounds it and says where. |
||
|
|
2b5e7d6602 |
qoder 0.2.69: a Kimi model's call-only turn carries a space, as QwenWork's Kimi needs (#1213)
nanfei892 measured it (#1213): on QwenWork, kimi-k3.1-pro answers 400 "Error in upstream response" (a 502 from magpie) to any request whose history holds an assistant turn with tool_calls and a null or empty content, which is how every OpenAI client records a call-only turn. So every agent broke from its second turn on. One space is served, and DeepSeek, GLM and Qwen on the same account take the empty turn. qoderBody now passes qoderMessages a callText of " " for a Kimi model (key kmodel*, or "kimi" in its key or name, on any Qoder site), and a call-only turn takes it when it has no text. A turn with text, and every other model, go as before. Run (temp HOME): bun test in packages/qoder 443 pass, 0 fail (mote); bun scripts/check.mjs qoder ok. Broken by hand: without the callText fallback, the new test's Kimi case fails (mica). Not tried: a real QwenWork Kimi account (none here); the reporter's own patch of the same line has served them since 15:50 UTC+8. Qoder CN's kmodel gets the space too, unmeasured there. |
||
|
|
76cfb7fe86 |
qoder 0.2.68: a bare {"tool_calls":[...]} reply is its calls (#1113)
A model on Qoder CN (auto/minimax-m3.1-flash) answered with OpenAI's own
wire shape written as text, {"tool_calls":[{"name","arguments"}]}. The
Splitter only knew <tool_call> and the bare XML tags, so the block went
out as the answer with finish "stop" and the calls were lost.
The Splitter now reads such an object as those calls and finishes
tool_calls. It counts only when the object starts its own line, its first
key is "tool_calls", and it is outside code (quoted()). Each entry needs a
name and arguments that are an object or a JSON string ({name, arguments}
or {function:{...}}). It is held until its braces close. A block cut short
at the end of the stream, or with an entry that can't be read, ends the
turn as an error (502 when not streamed), as #132's <tool_call> block
does. An empty array, other JSON, and JSON in prose or code stay text.
Unlike the XML path, this isn't gated on declared tools: the reporter's
request declared none, and the <tool_call> path isn't gated either.
jsoncall.test.mjs uses the issue's bytes: bare, prose then bare, whole
and in 3- and 1-char pieces, streamed and not, the <tool_call> control,
string arguments, four error shapes, and seven text-stays-text cases.
Run (WSL magpie-desktop, bun, HOME=$(mktemp -d)): packages/qoder
`bun test`: 440 pass, 0 fail. jsoncall+textcall+xmlcall at the pushed
tree: 26 pass. `bun scripts/check.mjs qoder`: ok.
Broken by hand (detection turned off): jsoncall goes 7 fail, 2 pass
(the control and text-stays-text).
Siblings filed: #1114 (doubao-work, orcaterm, trae, zen-free).
Not tried: a live Qoder CN account.
|
||
|
|
0135b7b0ea |
agy-cli 0.1.32: the first model list after warming has agy's Claude and GPT models (#1064)
On a signed-in agy, `agy models` takes about 4.4s and `agy acp`'s
session/new about 3s. provider.models() needed three calls before
claude-opus-5-5, claude-sonnet-5-5 and gpt-oss-120b showed up, and
OpenCode 2.x calls it once.
What changed:
- packages/agy-cli/index.mjs:
- The offered-model probe now starts in listAgyModels' .then, as soon as
a non-empty list arrives and a caller asked for probeOffered. It no
longer waits for the next models() call. A hung or failed `agy models`
still never spawns the probe.
- probeSignedIn reuses the `agy models` stdout it already has. The same
parser (parseAgyModels, split out of listAgyModels) fills
cachedModelCatalog, and the probe starts. Sign-in waits for the probe
for at most 3s.
- The offer (acpOfferedModels, acpOfferedKey, offeredProbeAt and any
in-flight probe) is forgotten when agyPath changes and after a new
sign-in finishes. A generation counter drops the answer of a probe
that started before the reset.
- provider.warming() returns a promise while a list or probe is still
running, and null when nothing is.
- scripts/opencode2.mjs, copied byte for byte to every
packages/*/opencode2.mjs: after the first background refresh, the
adapter awaits hooks.provider.warming() once, for at most 60s, and then
refreshes once more. It does not loop. Plugins without warming() behave
as before.
- Not done: the issue's on-disk catalog cache (point 3), skipped as asked.
Known gap: agy-cli has no `config` hook, so under OpenCode 2.x the adapter
lists no provider for it. refresh() returns before it calls
provider.models(), so the follow-up refresh can't add agy's models on 2.x
until agy-cli gets a config hook.
Tests: test/testkit.mjs's fake agy takes a sessionNewDelayMs. The new
tests in test/catalog.mjs set 1.5s on both `agy models` and session/new
and wait for state through warming(), with no fixed sleeps:
- On a slow cold start, the first models() after warming lists Claude and
GPT, from one probe spawn.
- authorize() on a signed-in agy fills the catalog, and the next models()
runs no second `agy models`.
- The sign-in wait is bounded: with a 6s session/new, sign-in returns in
about 4.5s.
- Changing agyPath probes again.
The hang test now awaits warming() before it counts acp spawns.
scripts/opencode2.test.mjs: the warming list is read a second time when
warming ends, and only once when nothing is warming.
Run on Linux (a separate test Mac was over its load limit):
- packages/agy-cli bun test: 17 pass, 0 fail.
- bun scripts/check.mjs agy-cli: ok.
- bun scripts/check.mjs (all packages): ok.
- Root bun test in a temp HOME: 8530 pass, 19 skip, 0 fail.
Broken by hand on Linux, each red, then restored green:
- No probe in the .then: the slow cold-start test.
- probeSignedIn drops the list: the authorize and bounded-wait tests.
- agyPath change keeps the old offer: the agyPath test.
- Unbounded sign-in wait: the bounded-wait test (7514ms).
- Probe also on a failed listing: the hang test.
- origin/main's index.mjs with the new tests: all four #1064 tests.
- Adapter reads the list once: the warming adapter test, and the
copy-identity check.
Not tried: a real agy (no Google sign-in, no network). The reset after
login.finish has no unit test of its own.
Reported-by: hiee3
|
||
|
|
bc9f611e34 |
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. |
||
|
|
92c20ffef6 |
Eight auth hooks declare rotating refresh tokens (#1027)
Eight auth hooks declare `rotating: true`: cline, codearts (and OfficeAce), factory, minimax, nous, qoder, sensenova, workbuddy. Each package's own code says the vendor refuses a spent refresh token. magpie then stops carrying these sign-ins to another computer through Sync, a backup or a Restore (internal/provider/signins_carry.go). Trae was dropped: its refresh keeps the old token when the answer has none, and there is no evidence it rotates. Each package's patch version is bumped (cline 0.1.15, codearts 0.3.13, factory 0.1.46, minimax 0.2.9, nous 0.1.3, qoder 0.2.66, sensenova 0.2.3, workbuddy 0.2.30). Each was checked against npm, or against origin/dist for the dist-only packages, before the merge. Fixes #884. Run at cc2f9199 (a fast-forward of origin/main), on mica with a temp HOME: bun test over the eight packages gave 1588 pass, 0 fail, and scripts/check.mjs exited 0. CI's test and on-npm jobs pass. At 45c8fdb4, mote gave 1834 pass with Trae included. Not tried: a real refresh against each vendor. Co-authored-by: yetihan <yetihan@users.noreply.github.com> |
||
|
|
34786edadb |
qoder 0.2.65: two tool calls at one index with their own ids are two (#930)
Qoder Ultimate sent two native tool calls at tool_calls[].index 0, each
with its own id and name. events() kept one call per upstream index, so
the second call's arguments were sent as more of the first:
{"key":"A"}{"key":"B"}, which the client refused as unparseable JSON.
A fragment with a non-empty id that differs from the open call's id at
that index now starts a new call with an output index of its own. A
fragment with no id, or the open call's id, still goes on with the open
call (OpenAI's argument fragments, and relays that repeat the id). A call
pushed aside before it got a name still counts as nameless (#579).
After two ids at one index, id-less fragments go to the newer call; the
report suggested failing there instead, but OpenAI streams each call's
fragments right after its start, so the newest is the one open.
Siblings with the same index-keyed fold, fixed the same way:
- zed 0.1.19: chatWhole (a streamed chat reply folded for stream:false).
- codearts 0.3.7: completionFromChunks.
- zen-free 0.1.27: stream.mjs chatAccumulator, and tool-response.mjs's
chat buffer, which gives each call its own index when two collided.
- page-chat 0.1.13: lib/server.mjs folds through toolCallFolder.
Looked at and left: codearts' stream name restorer and kimi-desktop's
Agent hold pass fragments through unchanged and join no arguments;
zed's streaming path passes Zed's chunks through, and magpie's gateway
already starts a new call on a new id (internal/gateway/chat.go).
Run (WSL magpie-desktop, bun 1.4.2, node 22):
- pedh's repro.mjs with his fixture: [0,0] gave one tool event plus an
args event on 0.2.64; now two tool events (index 0 and 1), each with
valid JSON. [0,1] unchanged.
- HOME=$(mktemp -d) bun test packages/qoder packages/zed
packages/codearts packages/zen-free packages/chat: 987 pass, 0 fail,
1 skip (the epub reader's, as before). bun scripts/check.mjs: every
package and registry.json ok.
Broken by hand:
- qoder back to index-only: 3 of the new tests fail (two ids, id-less
after a second id, streaming adapter).
- qoder starting a call on any fragment without the open id: 8 fail,
the id-less continuation test among them.
- qoder treating any id as new: the repeated-id test fails.
- zed, codearts, zen-free (both) on main's code and chat keyed by index
only: each new collision test fails (5 of 5).
Not tried: a real Qoder account (no Qoder Ultimate here), real Zed,
CodeArts or OpenCode Zen replies with a collision, and the chat page
in a browser.
Reported-by: pedh <pedh@users.noreply.github.com>
|
||
|
|
e2d15ba653 |
qoder 0.2.64: a model off for credits used up is a 429 quota (#880); qodercli 1.21.2's single-file runtime on Windows (#879)
#880: on an international personal_professional_trial account whose 800 credits were used up, Qoder's listing had dfmodel off, and ask() answered its own 400 `unknown or disabled model "dfmodel"`, which magpie reads as the request's fault: a routing group neither failed over nor rested the account (yetone/magpie#5726). - models() records the keys the live listing names and has off (l.off). - ask(): a known model the listing has off, on an account whose usage (/sash/api/v2/me/usage, device token rotated once as usage reads it; a PAT account's on its job token) says the pools spent in turn have no credits left, is answered 429 "usage limit reached: the account's credits are used up (800 / 800 credits), and Qoder lists "dfmodel" off for it until they refresh", before any job-token renewal. magpie's failure() reads that as failQuota (429 + usage limit, no brokeWords). - Kept as before: a model off while credits are left, or when the usage can't be read (unknown, not quota), goes to the #484 renewal and the 400; an id Qoder never served is the 400 at once with no usage read. - usage() reads the envelope through the same usageEnv helper. #879: qodercli 1.21.2 on Windows caches the helper as .qoder\.bin\runtime-info-win32-x64-<hash>.exe beside sgsdk.dll, and campaignRuntime took only the 1.1.66 folder umid-win32-<arch>-<hash>\. Both are now taken, the newest by mtime; another arch's file and a non-.exe (a .tmp) are passed over. Run (mote, load ~900): packages/qoder bun test 424 pass 0 fail; bun scripts/check.mjs qoder ok. Broken by hand: the new tests against the old index.mjs: 5 red (#879's single file found the umid folder instead; #880's 429 was 400; spentOf missing). Fixtures: #879 uses the reporter's file names (runtime-info-win32-x64-faa59bbe39db0bd1.exe, sgsdk.dll). #880's issue gives the plan, 800 credits used 100% and dfmodel off, but not the listing's or usage's bytes; their shape is the other qoder tests'. Not tried: a real out-of-credit Qoder account; Windows itself (the runtime test forces platform win32 on mote); where Qoder desktop 1.21.2 keeps its helper now that resources\umid is gone (the reporter's second point; QODER_RUNTIME_INFO still covers it); the repo-wide bun test (mote at load ~900; only packages/qoder changed). Reported-by: zane668 (#880) Reported-by: ArmedHelicopter (#879) |
||
|
|
087c36123d |
inkstone 0.1.3: image-caps preflight, a zero-prompt browser sign-in, key calls on the session cookie (#832)
inkstone 0.1.3 (#832, yunwang2442-creator): - Image requests are prechecked before they leave: 8 images, 10MB each, 40MB in all. - A request over a cap gets a local 400 shape refusal, so magpie asks the next account and rests none. - The plan's invalid_media / media_fetch_failed / unsupported_media_type errors become the same kind of refusal. - The body rewrite strips the reasoning fields and sets image detail to auto. - A zero-prompt browser sign-in comes first, and a second browser method reuses a pasted key. - Neither browser method is offered when no Chromium-family browser is found (#825). - The /keys calls ride the session cookie, without the pagination query. Key creation retries the console's -15100 "refresh page and retry". - The #826 metadata token read is kept, and its test is back. - The fake browser is built once per user and source hash (#824), and the title wait reads only on Windows. - maxConcurrency is 4. - The doubled comment line is dropped from every opencode2.mjs copy, agy-cli's included. Reviewed at 88e66bde, on mote (macOS, Bun 1.4.2) with a temp HOME: - full bun test: 6853 pass / 0 fail; both checks exit 0 - bun scripts/check.mjs and bun scripts/check.mjs inkstone: exit 0 - 21 hand breaks: 20 red, 1 not caught (the /keys pagination test calls protocol.listKeys directly; follow-up filed) Not tried: a real InkStone account or sign-in, Windows and Linux runs. |
||
|
|
e7004d9354 |
inkstone 0.1.0: Intern InkStone (书生·端砚) Token Plan, browser sign-in, credit card and ink-* key chat (#775)
New package @magpie-community/opencode-inkstone-auth 0.1.0 for Intern InkStone (书生·端砚, Shanghai AI Lab) Token Plan, provider id `intern-inkstone`. Community package by yunwang2442-creator. What it does: - Browser sign-in (Edge/Chrome, its own profile under $XDG_CONFIG_HOME or ~/.config/magpie/inkstone-browser, or %LOCALAPPDATA%\magpie\inkstone-browser). The login window has no debugging port. A headless CDP read takes the uaa-token cookie, and the same read renews it silently later. - Usage card: ink-credit balance, 5-hour and 7-day windows, credit packs. - Chat: a pasted ink-* API key, or one the sign-in creates, named ink-<host4>-<acct4>-<rand4> (18 of the console's 20 characters). An idempotency clash (-15109) retries with a fresh name, up to three times. Pruning is on by default. It only touches this machine's and account's prefix, keeps the newest two and the key this sign-in created, and never deletes manual keys or keys of unknown age. - Closing on Unix: SIGTERM, then SIGKILL only after a 15s grace. Leftover browsers are matched by --user-data-dir=<escaped profile>, and Windows uses .Contains(). - The login wait comes from an injected waitForLogin in tests. No env hook is left in production code. - Hosts: discovery.intern-ai.org.cn, discovery-api.intern-ai.org.cn, 127.0.0.1 (CDP). Outside the package: scripts/opencode2.mjs lets a prompt with `required: false` stay optional (`p.required !== false`). Every package's copy is synced byte for byte, so all 39 copies in the merged tree are blob |
||
|
|
978bb42bce |
qoder 0.2.63: max_tokens never goes above the model's ceiling (#822)
Qoder CN's QoDuck (lmodel) refuses a max_tokens above 131072 with a 400 "Error in upstream response: Range of max_tokens should be [1, 131072]". qoderBody sent the client's budget unchanged (a DeepSeek-sized 384K from DeepSeek Harness / pi), and failure() read every "Error in upstream response" as the vendor's transient 502, so magpie retried on each account and rested them all with backoff; lmodel never answered. - qoderBody holds max_tokens to the model's ceiling and never raises a smaller one: what a refusal named for that model key, else the listing entry's max_output_tokens, else OUTPUT_CAPS (lmodel 131072). The context_length window is counted with the held value. - failure() reads "Range of max_tokens should be [lo, hi]" before the upstream-failed 502 as the request's 400 (signIn ""), with Qoder's words and the ceiling. - ask and askLingma send such a refusal again once at that ceiling and remember it for the model, so a model with no known ceiling (any other Qoder, Qoder CN or Lingma model) answers too. Refused again, the 400 goes back as Qoder said it. Siblings: one body builder (qoderBody) serves every site (qoder, qoder-cn, QwenWork, enterprise, VPC, dedicated, Lingma) and both stream=true/false; the plugin has no Responses path. The HTTP reply and the stream's envelope both go through failure(). Run (mote): packages/qoder bun test 417 pass; bun scripts/check.mjs qoder ok; repo HOME=$(mktemp -d) bun test 6662 pass 0 fail. Fixtures use the issue's literal error text. Broken by hand: without the clamp 19 of the new tests red; without the range read 11 red; without the resend 10 red. Not tried: a real qoder-cn account on lmodel (none here); whether Qoder also validates context_length (the issue could not capture the body); the learned ceiling is kept per model key in the process, not per site. Reported-by: Gruu6y |
||
|
|
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
|
||
|
|
f7e87877e0 |
qoder 0.2.61: publishes 1a99e2c's business.model_key (#692, #638)
0.2.60 went to npm from |
||
|
|
1a99e2c48b |
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. |
||
|
|
c1a625d0d5 |
qoder 0.2.60: a 429 with no quota in it shows Qoder's status, code and own reply (QwenWork flash through dsh: "All models failed")
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. |
||
|
|
1984cf65dd |
qoder 0.2.59: usage carries each pool's count and the plan's refresh, as Qoder's own panel shows them (jzing.draw)
jzing.draw on Discord (#feedback, 2026-11-03): Qoder's 我的用量 said 套餐内 Credits 1,817 / 2,000 (剩余 183, refreshing 2026-11-22) and 资源包 2,400 / 3,400 (剩余 1,000). magpie's Routing row said a bare "剩余 15%", which matched neither pool, so it read as the two not added up. They were added up already (Total credits since 0.2.44, #454), but every window sent only a share and a display string. The Routing row shows a count only for a window with limit > 0, so it had no way to say which figure it was. Now: - every pool window and Total credits carry amount, limit and unit, so magpie says "1,183 / 5,400 credits · 22% left" on the Routing row and the Usage card, which is Qoder's 183 + 1,000. - the plan's Credits window carries resetsAt = expiresAt, Qoder's "将于 … 刷新" date (renewsOn in Qoder 0.4.3's buildUsageItemGroups). Routing still counts the pools together and sets each pool aside; that didn't change. Run (mote, bun 1.4.2): bun test packages/qoder: 382 pass, 0 fail. Broken by hand: with amount/limit/unit and resetsAt dropped from the pool windows, the new test ("the plan and the resource pack read as Qoder's own panel does…") fails. Not tried: no real Qoder account. The fixture is built from the reporter's screenshot numbers. The reporter's "15%" (85% used) isn't reproduced from those numbers: the two pools together leave 22%. It may be a reading taken later than the screenshot, or a dedicated resource package Qoder's panel didn't show (the plugin counts those). Without their reading this can't be told apart. |
||
|
|
17e5ef7457 |
all: load on OpenCode 2.x through a default {id, setup} (#657)
nbczw8750 (#657): trae 0.2.26 on OpenCode 2.2.5 fails with "Plugin must export a default definition with an id and an effect or setup function. (cause: SchemaError(Missing key at ["default"]))". 2.x imports a package's exports["."] (a plugin dir and an npm install alike) and has no V1 path at all, so every package here that serves models failed the same way, not only trae. Every one of the 32 model packages now has: - opencode2.mjs, exports["."]: a copy of scripts/opencode2.mjs, an adapter that runs the package's V1 plugins inside 2.x's promise API. Config providers become 2.x providers (package pinned so the aisdk sdk hook runs), V1 auth methods become integration methods (oauth auto/code with forms; api without authorize as a key method), V1 credentials are kept in metadata.v1, the loader's baseURL, apiKey, headers and fetch are applied through the sdk hook, an auth.set renewal is stored per credential, and credential.switched /updated reload the account's own model list. - opencode.mjs, main: re-exports the V1 plugin functions only. OpenCode 1.x and magpie's host.js take main. On 1.x, trae 0.2.26's main exported a non-plugin (_internal) and 1.19.5 refused it ("Plugin export is not a function"); the new main fixes that too. - both files in "files"; patch version bumped. devin already had 2.x and is unchanged. scripts/check.mjs fails a model package whose 2.x entry has no default {id, setup}, whose opencode2.mjs differs from the canonical one, whose entry is missing from files, or whose main exports a non-plugin. Run at this head (mote): - HOME=$(mktemp -d) bun test, as CI runs it: 4900 pass, 0 fail (4914 tests, 374 files). A first run set globalThis.fetch for the whole process from opencode2.test and failed 528 tests in other packages; the block is now set and put back around that file's tests. - bun scripts/check.mjs: every package passes. With the network blocked cloudflare-workers-ai fails on its fetched catalog, the same on origin/main. - Real OpenCode 2.2.5 (npm opencode-ai), sandbox HOME, packed trae 0.2.27: loads with no error; /api/integration lists trae-cn "Trae CN" and trae-global "Trae Global" with their browser sign-ins; `auth login` starts the trae.cn authorization and waits (cancelled there); with a fake credential POSTed to /api/credential, `opencode models` lists trae-cn's six models. - Real 2.2.5 with a fake V1 key plugin through the same adapter against a local fake server: `auth login` with a key, `models`, `opencode run` reached /real/v1/chat/completions with the loader's "Bearer loader-sk-fake" and header, and printed the fake's reply; with @ai-sdk/anthropic it reached /real/v1/messages with x-api-key from the loader. This run found the key method missing after 2.x's second integration transform (a once-only flag outside the transform); fixed, and opencode2.test checks a rebuild. - Real OpenCode 1.19.5, sandbox HOME, trae 0.2.27: `opencode models` lists trae-cn and trae-global models; 0.2.26 failed there. Broken by hand (scratch copy, bun test scripts/ and check.mjs): - trae's exports back to "./index.mjs": the trae 2.x test fails (default.id undefined), check fails trae with "OpenCode 2.x: ./index.mjs has no default {id, setup} (plugins#657)". - zed's opencode2.mjs changed: the copies test fails, check fails zed "differs from scripts/opencode2.mjs". - the key flag back outside the transform: the 1.x plugin test fails on the rebuilt sign-ins (key missing). Not tried: a real sign-in with a real account on 2.x; Windows (the reporter's OS); chat.headers, chat.params, usage and tool hooks, which the adapter doesn't carry to 2.x; the tools/pages packages (calc, goanyapi, layerfs, search1api, aelios, agent-console, chat, fingerprint, nowledge-mem, kimi-desktop), which still load only on 1.x. |
||
|
|
d40a074828 |
qoder 0.2.57: QwenWork's gateway calls name the client, and a biz account refreshes for its team (tnt1223)
tnt1223 (Discord) signed in to QwenWork. Test models and the model list
both failed: "QwenWork models: HTTP 403: {"code":"403","message":"User
identity could not be verified"}". No QwenWork account was at hand, so
the case wasn't reproduced. These are the differences from QwenWorkCN.app
1.2.1 (its out/main/main.js) that the code shows:
- openApiJsonRequest puts User-Agent qoderwork/1.2.1, a fresh
X-Request-Id and getQwenWorkClientHeaders (X-QwenWork-Version,
-Release-Version 1.2.1-26092107, -Build 26092107, -Platform, -Arch,
-Channel stable) on every gateway call. These cover the device poll,
the account-context, wallets and the device token's refresh. The
plugin sent none of them. It now sends them on the QwenWork sites
(site.clientHeaders), in openapi() and in usage's read.
- refreshDeviceToken asks for {target:"biz", team_id} when the account
is a biz one (getIdentityFromUser: is_biz with an org and a team, read
through normalizeAccountContext), and for "c" otherwise. It adds
client_id and redirect_uri when the client signs in with that pair.
The plugin always asked for "c", which turned a biz account's token
personal on its first refresh. The sign-in now records identity and
teamId (accountIdentity), and deviceRefreshBody asks as the client
does. An enterprise-domain account sends no redirect_uri, since its
sign-in has none (siteOf).
- The 403 on the model list now adds that the sign-in's identity wasn't
recognised, and to sign in again. Other 403s read as before.
Qoder and Qoder CN are unchanged. A test checks that a Qoder call
carries no X-QwenWork-* or User-Agent, and that the refresh body is the
token alone.
Run on mote (bun 1.4.2):
- packages/qoder bun test: 381 pass, 0 fail.
- bun scripts/check.mjs: all packages ok.
Broken by hand in a copy, with the client headers dropped, the refresh
always "c", the identity not recorded, the enterprise redirect_uri kept
and the hint removed: 4 of the new tests failed.
Not tried:
- A real QwenWork account, personal or biz, so it isn't known that
these were the cause of the 403.
- The chat's Cosy-* signing. The official app signs it through its CLI's
wasm (sign-request), and that wasm also has Cosy-Organization-Id,
Cosy-Organization-Tags and Cosy-Data-Policy, which the plugin doesn't
send. Which account fields fill them wasn't read out of the wasm.
|
||
|
|
a16adb3025 |
qoder 0.2.56: Qoder CN signs in to a Lingma 1.0 dedicated domain with Qoder CN IDE's account (Milktea)
Milktea (Discord) said the plugin still can't sign in to their Qoder CN
IDE enterprise dedicated domain (企业专属域). Their domain answers 404 at
/algo/api/v1/version, so Qoder IDE 1.38.0 counts it as Lingma 1.0
(dedicated_lingma; the IDE then logs "use extension 127 login" and leaves
the sign-in to its language server). 0.2.53 refused such a domain.
Milktea measured these on that host (their gist):
- /device/selectAccounts and /api/v1/jobToken/exchange answer 404.
- A console PAT or the console's cookies get 105 "Login timeout" at /algo.
- /algo/api/v3/user/* answers "Request discarded".
What works is the session the IDE's worker keeps:
- <cosyHome>/cache/id holds the machine id (or <cosyHome>/id).
- <cosyHome>/cache/user is base64(AES-128-CBC(JSON)), with key = IV =
the id's first 16 chars. The JSON has uid, organization_id, email,
security_oauth_token (pt-), refresh_token and expire_time.
What changed:
- The dedicated method's 404 branch now reads that cache (lingmaSignIn).
The account it saves has lingma: true, the domain, the IDE's token and
its machine id, and is named <email> (<domain>). With no cache, or a
lapsed one, the sign-in says so and lists the folders it looked in.
- cosyHome comes from the CN IDE's main.js: <userDataPath>/SharedClientCache.
That is ~/Library/Application Support/QoderCN on macOS, %APPDATA%\QoderCN
on Windows and $XDG_CONFIG_HOME (~/.config)/QoderCN on Linux. The gist's
Linux-only folders, ~/.lingma and QODERCN_COSY_HOME are read too.
- Every call goes to the domain itself (lingmaSite). The chat is signed
as the gist captured the worker signing it: Cosy-ClientType 0, version
2.5.18, no Cosy-Scene or Cosy-Business-*, the assistant scene, and
model_config format dashscope.
- The models are the IDE's own keys: qmodel_latest, dashscope_qmodel and
q36fmodel, all modelSelector.item.* names in the CN IDE's workbench. The
domain's own list names keys its chat refuses. A "Model not exist" said
in the stream falls through to the next key.
- Renewal reads the cache again; the worker renews its own token ("CN 1.0
refresh" in its strings). This happens near the token's end, in
auth.refresh, and once after a 105. With nothing newer, the account
gets a 401 marked expired that says to open Qoder CN IDE.
- Usage reads nothing, and the check-in is inactive.
- events: a frame with no choices that holds an error, or a code and a
message, is now the turn's failure. Before, it was read past, which gave
an empty answer. This is the only change outside the Lingma path.
- README: a section on Lingma 1.0 domains.
Run (mote, bun 1.4.2): packages/qoder `bun test`, 375 pass, 0 fail. The new
lingma.test.mjs has 11 tests, with fixtures in the gist's literal shapes.
fetch is stubbed and HOME is a sandbox. On 0.2.55 all 11 are red. `bun
scripts/check.mjs` passes. dedicated.test.mjs lost its "Lingma is refused"
test, which lingma.test.mjs now covers.
Broken by hand: with Cosy-Scene and Cosy-Business-* kept, and with the
events error frame off, 2 of the 11 went red (the chat's headers, and the
fall-through on an error said in an OK frame).
Not tried:
- Any real Lingma dedicated domain or real Qoder CN IDE cache. Milktea's
gist was run against one; this code wasn't.
- The cache's AES key, the SSE wrapper, the version 2.5.18 and the
missing headers come from the gist's capture, not from the IDE's code.
- Whether the cached account belongs to the domain entered isn't checked
(the cache doesn't name a domain).
- The Remote-SSH layout (<machineId>/SharedClientCache).
|
||
|
|
58adeadfac |
qoder 0.2.55: a request whose max_tokens is 1024 or less does not think at the default (#643)
The same default as WorkBuddy's #643 (itspig): qoderBody's effortFor thought at the model's default effort when no effort was asked, so a title asked at a small max_tokens could spend it on reasoning. A request that names no effort and a max_tokens (or max_completion_tokens) of 1024 or less is now asked as "none": thinking off, or the lowest level for a model that always thinks. An asked effort, and a larger or unnamed budget, are unchanged. Run, at this head, on mote: - packages/qoder: bun test, 365 pass, 0 fail; small-budget.test.mjs new. - bun scripts/check.mjs qoder: ok. - Broken by hand (the SMALL_BUDGET line in effortFor removed): small-budget.test.mjs is red, 1 pass, 1 fail. Not tried: a real Qoder account. Qoder answers 401 to the owner's account (plugins#181), and no Qoder report showed a small budget spent on thinking; the change follows WorkBuddy's measured case. Other siblings checked: trae, devin, commandcode, loomy and kiro send only an effort the client asked or leave the server's default; none add one. |
||
|
|
fa144e4c9e |
qoder 0.2.54: a request's model_config is built as Qoder's client builds it, not sent as the listing entry (#638, square-235)
square-235 (plugins#638): on Qoder CN, magpie's DeepSeek-Flash (dfmodel)
calls show in QoderCN's billing as "Auto", charged at Auto's rate, while
Kimi-K3.1-Pro (kmodel_latest) calls are billed as themselves. Their
screenshots show magpie asking qoder-cn/dfmodel, and the billing rows at
those times saying Auto.
The model id did map: X-Model-Key and model_config.key were dfmodel. What
differed from Qoder's own client was model_config. The plugin sent the
model's listing entry whole. Qoder's client (CN CLI @qodercn-ai/qoderclicn
1.1.81 Pcu, desktop 0.4.3 nzc, the qoder-agent-sdk worker) sends a trimmed
object: key, display_name, model "" (or outer_provider), format, is_vl,
is_reasoning (false when thinking is off), api_key "", url "", source,
max_input_tokens (2e5 when missing). dfmodel's entry carries a
minimal_version (on qoder.com {"cli":"0.1.25","jb_plugin":"0.15.0",
"ide":"0.3.0"}; in the CN listing {"vsc":"999.999.999"}) and kmodel_latest's
on qoder.com has none, which matches the one billed wrong. Likely cause,
not confirmed: no Qoder CN account was used.
- modelConfig(m, thinking) builds the client's object, and qoderBody sends
it in place of m.config.
- The class: a model whose entry has no key, or key auto/default, or a key
other than the one asked for, is refused. ask answers 400 with the
reason and sends nothing. The worker reads a missing key as "auto". A
model id the listing doesn't have was already a 400 before any send.
- README: the Models section says what model_config carries now.
Not changed: the worker also sends chat_context.extra.modelConfig {key,
is_reasoning}; the plugin still doesn't. X-Model-Key/X-Model-Source stay.
Run (mote, bun 1.4.2), at this tree: packages/qoder `bun test`, 363 pass,
0 fail, with the new model-config.test.mjs (8 tests built from the real
testdata/listing.json and cn-listing-free-view.json bytes; the CN listing
is a free account's, so its entries are turned on in the test and nothing
else is changed). `bun scripts/check.mjs` passes.
Broken by hand: with model_config back to m.config, 6 of the 8 went red
(the four dfmodel/kmodel_latest shape tests on qoder and qoder-cn,
is_reasoning off, the key refusal). With the key guard removed, the
refusal test went red.
Not tried: a real Qoder CN chat with dfmodel, and whether the billing row
now says DeepSeek-Flash. The upstream SSE "model" is "auto" for every
model (seen on a real qoder.com kmodel_latest call), so it can't tell.
QwenWork and QwenWork Enterprise get the same model_config and were not
tried.
|
||
|
|
731277004a |
qoder 0.2.53: Qoder CN signs in to an enterprise dedicated domain (企业版专属域)
Milktea (Discord) has a Qoder CN enterprise dedicated domain on <corp>.rdc.aliyuncs.com. Qoder IDE signs in to it through 「企业版专属域登录」 once the domain is set in its settings. The VPC method takes only <instance>.vpc.qoder.com.cn, so it refused the domain. The new method, "Sign in with Qoder CN Enterprise dedicated domain (企业版专属域)", takes any https host. It follows Qoder IDE 1.38.0's workbench (config.general.dedicatedUrl, _loginDedicatedWithProbe): - It asks GET <domain>/algo/api/v1/version. A 404 is a Lingma 1.0 dedicated domain. Its sign-in is cosy's login/generateUrl with a qoder-cn-ide:// callback, which this plugin doesn't serve, so it is refused with what it is. Any other status is Qoder CN 2.0. If nothing answers, the domain is refused (the IDE falls back to Lingma there). - For 2.0, the domain's origin serves /device/selectAccounts, with the IDE's client id f5a7f67c-… and no redirect_uri. The poll, user info, tokens and usage go to <label>-openapi.<rest>, and models and chat to <label>-gateway.<rest>. These hosts follow the IDE's RNc/TNc/JL0 rule, which keeps the origin for an IP or a dotless host. - Inferred: the IDE's language server picks the chat host, and its rule wasn't read. The account chats on the gateway host if that host answers at sign-in. If not, it chats on the domain itself, which answered on /algo. The pick is kept as dedicatedApi. The domain is kept on the account as `dedicated` (and `vpc`, for its name suffix). siteOf routes it before the VPC rule. A kept domain that isn't one is asked to sign in again, never sent to the public hosts. Run (mote, bun 1.4.2): packages/qoder `bun test`, 355 pass, 0 fail (dedicated.test.mjs 10, vpc.test.mjs 17 unchanged). `bun scripts/check.mjs` passes. Broken by hand: with siteOf's dedicated branch off, the 404 check off, and the origin fallback off, 4 of the 10 dedicated tests went red (Lingma refusal, gateway chat, origin fallback, renewal). Not tried: any real dedicated account, either kind. The fixtures come from the IDE's code, and the reply shapes are the VPC ones (#312). The Lingma 1.0 path is not implemented. |
||
|
|
7a79949ccb |
qoder 0.2.52: an account's model list on a job token Qoder lists only the free model for is renewed once and read again
star21321321124_93024 (Discord #general, 2026-11-01): a Qoder CN personal
account with all 1500 credits left listed one model in magpie, the free
Flash ("Qoder CN: 1 model"), so agents saw only that one.
Cause, from Qoder CN's real bytes: gateway.qoder.com.cn's
/algo/api/v2/model/list answers a caller it doesn't take for an account
with every model that costs credits `enable: false` and the free
Qwen3.8-Flash on, in every scene (captured 2026-11-01 for an unknown uid,
kept as testdata/cn-listing-free-view.json). plugins#484 saw the same view
for a stale job token on qoder.com. 0.2.49 renewed the job token when a
chat asked for a model that list had off, but provider.models (the list
magpie and its agents see) read it as it came, so the account showed
the free model alone and nothing renewed it.
Now models() marks such a listing (freeView: some paid model, none on),
and the provider.models hook renews the job token once through relogin
(same lock and 5-minute rule as #474/#484), saves it, reads the list
again and says the renewal on the next usage read or answer. A renewed
token that still gets the free view is remembered and not renewed for the
list again, so an account that really has only the free models doesn't
spend a refresh token each time magpie lists.
Tests (cn-free-view.test.mjs, from the captured bytes; the account's list
is the same bytes with each model on):
- free view on jt-1 -> one refresh, all 10 app models listed, jt-2 saved;
listing again spends none.
- the next usage read says "renewed".
- free view on the renewed token too: listed as it is, one refresh over
three lists an hour apart.
- a list with paid models on spends none; freeView's edge cases.
Run on mote (Bun 1.4.2):
- cn-free-view.test.mjs against origin/main's index.mjs: 4 of 6 fail
(the list is ["qfmodel"]); with this change 6 pass.
- Broken by hand: the stillFree guard off, the "renewed once" test fails
(3 refreshes).
- bun test in packages/qoder: 345 pass, 0 fail. bun scripts/check.mjs: ok.
Checked live (read only): qoder.com's listing for the owner's account has
every model on in every scene, the same with its device token and with a
bogus token (qoder.com keys the list on the uid). Qoder CN's CLI
(@qodercn-ai/qoderclicn 1.1.81) reads the same /api/v2/model/list.
Not tried: a real Qoder CN account (none here), so it is not confirmed
that a renewal gives the reporter back the full list; if their token is
honoured and the list is still the free view, the account itself has
the paid models off and this change lists it as it is.
|
||
|
|
5403c21484 |
qoder 0.2.51: a native tool call that never gets its name no longer fails the turn (#579)
bigstage915 (Qoder CN, qoder-cn/qfmodel through ZCode) saw qfmodel now and
then begin a native tool call and never send its function name. events()
then ended the stream with "the model's native tool call has no name", an
SSE error frame on a 200, which ZCode reads as not retryable: the whole
turn died, with the reasoning and text already shown (9 incidents in four
days, after reasoning-end and after a named call's tool-input-start and
argument deltas).
An unnamed call is still never given, and its held arguments go nowhere,
not into the text. Now:
- Nothing of the answer said before it (no text, reasoning or call): the
reply is the same 502 as before, marked nameless, and ask sends the
request once more under a new request_id. A second such reply goes back
as the 502, before any byte, which magpie's gateway retries or fails
over (retryable: status >= 500).
- The answer had begun: the call is dropped and the answer ends as it
would have without it, tool_calls beside a named call, stop (or length)
otherwise, and console.warn says so (the host's stderr, in magpie's
log). The non-streaming reply is the same: named calls kept, the
unnamed one left out.
Tests (native-tools.test.mjs): the after-reasoning test now expects the
reasoning kept, no tool frame, finish stop and the warning; new cases for
an unnamed call after a named call's start and argument deltas (stream),
beside a named one (non-streaming, unnamed first and after), after text,
and nothing-said (asked twice, then 502; asked twice, second answer
given). The two 502 tests now also count two chat requests.
Run, on the WSL2 box (magpie-desktop, Bun 1.4.2; mote at load ~120):
- native-tools.test.mjs: 15 pass.
- The new test file against origin/main's index.mjs: the 7 new or
changed tests fail, the 8 others pass.
- Broken by hand: the in-plugin retry off, 3 fail (the retry tests);
reasoning not counted as said, 1 fails (after-reasoning).
- Full `HOME=$(mktemp -d) bun test` at this tree: 4469 pass, 1 fail,
agent-office's "midnight and metadata-only changes do not read JSONL
again", red alone on untouched origin/main
|
||
|
|
421cad6b25 |
qoder 0.2.50: a phone account's card shows its phone, not its uuid (#487)
A Qoder CN / QwenWork phone account's card shows its masked phone
(phoneLabel / cardName, usage's `user`), a real email first, instead of its
uuid; accountId stays exactly what main computes. A renewal reads the name
outside the plugin-wide lock from the account's own site (a VPC token never
goes to the public hosts) and renames nothing. Rebased on
|
||
|
|
3c279f66db |
qoder 0.2.49: a model the listing has off on a stale job token renews it once and reads the list again (#484)
On an enterprise qoder.com account under 0.2.48, 12 of the 14 app models (ultimate, fast, efficient, smodel, cmodel, qmodel_38max, gmodel, gfmodel, kmodel_latest, kmodel, dmodel, mmodel) were answered with the plugin's own 400 "unknown or disabled model" while dfmodel and qfmodel, the two free ones, were served. That 400 is said from the account's listing before any chat is sent, so the renewal 0.2.48 gave a refused chat (#474) never ran for those models. ask() now does what it does for a refused chat when a model Qoder serves (the site's shipped list, or any key a listing has named, on or off) is off or missing in the listing: relogin once (the pair saved since, else one refresh under the lock, not again within RELOGIN_GAP) and read the list again before the 400. An id Qoder never served gets the 400 at once with no renewal. Not proven: why the reporter's listing had only the free models on. The listing and lookup code is the same in 0.2.47 and 0.2.48; the fake here models a job token Qoder no longer honours in full getting the free view. There is no enterprise account here to reproduce it on. Run (mote-run, Bun 1.4.2): - listing-renew.test.mjs against cc3f000c's index.mjs (0.2.48): 3 of 5 red (the reporter's 14 ids get 400; the renewal isn't said). - the same file with this change: 5 of 5 pass. - bun test packages/qoder at this head: 325 pass, 0 fail (320 before, lapsed.test.mjs and usage.test.mjs from #474 still green). - bun scripts/check.mjs qoder: ok. |
||
|
|
cc3f000c6d |
qoder 0.2.48: a job token Qoder refuses as Login expired is renewed once and asked again (#474)
ahang39 (plugins#474): international Qoder answered dfmodel with 403 "Login expired" in bursts of ~16 requests over 2-5 minutes, about every 24h, shown by magpie as 401 "the sign-in lapsed". The report's times put the burst's start where magpie's renewal came due (saved end less the 10-minute lead) and its end where the renewed pair was saved: Qoder refused a job token the plugin still had as minutes from its end, and nothing asked again with a renewed one. Why Qoder ended it early isn't proven from the report. - A chat's 401/403 now marks the failure lapsed. ask re-reads the saved sign-in under the refresh lock: a pair renewed meanwhile (another request, magpie's auth.refresh, another process) is used with no refresh; else the refresh token is spent once, the pair saved, and the request sent once more. A burst shares one refresh. A token this process renewed under 5 minutes ago that is refused too isn't renewed again, so a refusal not about the token's end doesn't churn refresh tokens; the 401 is said as before. - A refreshed job token's end is read as an exchanged PAT's was: expire_time / expires_at (a date, or an epoch in s or ms) first, then expires_in, then a day. An end already past is ignored. Run (mote, mote-run, HOME=$(mktemp -d), --timeout 60000; mote at load 20-28): - packages/qoder: 320 pass, 0 fail. - whole repo: 3129 pass, 1 fail: commandcode "a plan saved stands in for a subscription slow to read" (16.8s against its 3s bar), passes alone 13/13, filed as #475. - bun scripts/check.mjs: ok. - lapsed.test.mjs on the old index.mjs: 8 of 9 red. The 9th (magpie's own renewal begun during the refusal) was rewritten after that run and not run against the old code again. Not tried: a real international Qoder account at the moment its token is refused; the fake Qoder (refusal body {"message":"Login expired"}, single-use refresh tokens) is built from the report's words only. |
||
|
|
f968917875 |
qoder 0.2.47: every model a site ships says whether it takes images (#470)
Every model a site ships now sets attachment and modalities.input either way, so a text-only model (QwenWork's three, Qoder CN's Lite) no longer falls back to models.dev's vote by bare model id. Run at 20043420a48079429896d861b33f2140261cf1df, on mote: HOME=$(mktemp -d) bun test in packages/qoder, 311 pass, 0 fail. Broken by hand (attachment: true for every model): config-capabilities.test.mjs goes 0 pass / 2 fail. Checked: QWORK_FALLBACK_LISTING marks all three QwenWork models is_vl: false, so text-only matches the vendor's listing. A signed-in account's own listing (is_vl) still takes over from the shipped list. Not tried: a real Qoder CN account's Lite with an image. |
||
|
|
b7bbc9dc06 |
qoder 0.2.43: the check-in says when to ask again, as the 10:00 (UTC+8) campaign opens
sdytman on Discord: Qoder's daily credits start at 10:00, can the plugin's
check-in follow it? Qoder's /me/campaigns lists each day's CLAIM_BENEFIT
campaign with startAt 10:00 and endAt 09:59 the next day, both UTC+8
("Daily reset: 10:00 (UTC+8)"), read with a real account at 09:27 CST on
10-28. Qoder.app 0.4.3 polls that list every 5 minutes and treats
startAt <= now < endAt as active; there is no next-time field. A check-in
before 10:00 met yesterday's campaign, and magpie settled for the Beijing
day, so today's campaign waited until tomorrow, or was lost.
checkin now returns until: the next campaign's opening (the later of
endAt and startAt + 1 day, or the next startAt in the gap) plus a minute,
on done, claimed and "not offered yet". All in epoch time, so the
machine's zone doesn't matter; qoder and qoder-cn share the code. magpie
asks again at until once it reads it (yetone/magpie, next release).
Run (mote): checkin-window, native-checkin and checkin tests under
TZ=UTC, Etc/GMT+8 and Asia/Shanghai, 66 pass each; HOME=$(mktemp -d)
bun test, 2938 pass 0 fail 8 skip; bun scripts/check.mjs. A real qoder
account at 09:35 CST: claimed 100, until 2026-10-28T02:01:00Z.
Broken by hand: nextOpens returning endAt only, 11 of 13 checkin-window
tests red; askAgain returning {}, 12 of 13 red.
Not tried: a real Qoder CN account (none here); the server's list in the
09:59-10:00 gap.
|
||
|
|
c0a0fd1955 |
qoder 0.2.45: a free account with no credits shows none left, not nothing
Ariel on Discord: an international free Qoder account signed in fine but showed no credits. A free account (userType personal_standard, Qoder's "Experience" plan) has a plan pool of 0 and, until it gets add-on credits, nothing else. parseUsage drops every pool whose total is 0, so such an account came out with no window at all and magpie had nothing to show. Qoder's own client (Qoder.app's buildUsageItemGroups) shows every pool present, 0/0 included, and counts the account out of credits when what the pools have left adds up to 0. Now, when no pool gives a window and the plan, add-on or shared pool reads a total of 0, the account has one "Credits" window, "0 credits left", used up. A pool that can't be read (a string total) or no pools at all still say nothing. An account with credits in any pool is shown as before (the owner's free account: plan 0, add-on 7 / 600, one Add-on window, unchanged). Same parser for qoder-cn. Run: HOME=$(mktemp -d) bun test in packages/qoder on mote (299 pass) and bun scripts/check.mjs qoder (ok). Broken by hand: the new test against origin/main's index.mjs, red (it reads no windows). Read-only real read of the owner's intl account's /sash/api/v2/me/usage for the envelope's shape (personal_standard, usageType credits, plan 0/0). Not tried: Ariel's own account; the fixture is the owner's free envelope with the add-on pool at 0 or absent, since the owner's has add-on credits. |
||
|
|
202ec68ffd |
qoder 0.2.44: a spent plan beside add-on credits left is no account used up (#454)
chansee97's Qoder CN trial had its plan's 300 credits spent and 245 of 1,100 add-on credits used, and Routing read the account as 0% left: each pool was a window of its own, and routing counts the tightest. Qoder spends the pools one after another before an account stops (docs.qoder.com/Credits: soonest to expire first, the plan's before add-on on the same day; teams: then the organisation's shared add-on credits), and its own envelope's totalUsagePercentage counts them as one. So when more than one of the plan, add-on and shared pools holds credits in the same unit, "Total credits" is what they hold together (545 / 1400 here, 61% left) and the one routing counts, and each pool is shown beside it set aside, as CodeArts' buckets are under its total. One pool alone is shown as before. Dedicated packages are left as they were (no word from Qoder on their order). Run: bun test in packages/qoder (298 pass) and scripts/check.mjs, on mote. Broken by hand: the new tests against origin/main's index.mjs, red (#454's reads 0% left; the rotated-token test's windows differ). Read-only real read of the owner's Qoder account's /sash/api/v2/me/usage: plan total 0, add-on 7 / 600, which stays one window, unchanged. Not tried: a real account with both a plan and add-on credits (the owner's has no plan credits); the fields are the ones that read returns. |
||
|
|
fd40b20c3b |
qoder 0.2.43: the check-in says when to ask again, as the 10:00 (UTC+8) campaign opens
sdytman on Discord: Qoder's daily credits start at 10:00, can the plugin's
check-in follow it? Qoder's /me/campaigns lists each day's CLAIM_BENEFIT
campaign with startAt 10:00 and endAt 09:59 the next day, both UTC+8
("Daily reset: 10:00 (UTC+8)"), read with a real account at 09:27 CST on
10-28. Qoder.app 0.4.3 polls that list every 5 minutes and treats
startAt <= now < endAt as active; there is no next-time field. A check-in
before 10:00 met yesterday's campaign, and magpie settled for the Beijing
day, so today's campaign waited until tomorrow, or was lost.
checkin now returns until: the next campaign's opening (the later of
endAt and startAt + 1 day, or the next startAt in the gap) plus a minute,
on done, claimed and "not offered yet". All in epoch time, so the
machine's zone doesn't matter; qoder and qoder-cn share the code. magpie
asks again at until once it reads it (yetone/magpie, next release).
Run (mote): checkin-window, native-checkin and checkin tests under
TZ=UTC, Etc/GMT+8 and Asia/Shanghai, 66 pass each; HOME=$(mktemp -d)
bun test, 2938 pass 0 fail 8 skip; bun scripts/check.mjs. A real qoder
account at 09:35 CST: claimed 100, until 2026-10-28T02:01:00Z.
Broken by hand: nextOpens returning endAt only, 11 of 13 checkin-window
tests red; askAgain returning {}, 12 of 13 red.
Not tried: a real Qoder CN account (none here); the server's list in the
09:59-10:00 gap.
|
||
|
|
ae48bf07f3 |
qoder 0.2.42: an earlier turn's thinking goes back in reasoning_content, as Qoder's client sends it
The plugin dropped an assistant turn's reasoning from its first version on, with no stated reason (uk.jent on Discord). Qoder.app's own client (qoder-agent-sdk's assistant converter) sends reasoning_content on every earlier assistant turn that had thinking, and Qoder's upstream accepts it. Now reasoning_content, reasoning or reasoning_details go back on a reply or a tool-call turn. A blank one (magpie's gateway sends " ") is none, and a turn with only thinking is still left out, as Qoder's client leaves it. Run: bun test in packages/qoder (282 pass) and bun scripts/check.mjs, on mote. Real account (intl, free plan), the plugin's loader with no renewal: DeepSeek-V4-Pro in a tool loop, its thinking before get_time naming a codeword, then asked for it: "TANGERINE-5519" with this change, and "no codeword was picked" on 0.2.41. Every probe was 200; none was refused for reasoning_content. Broken by hand: reasoning.test.mjs against 0.2.41's index.mjs, 3 of 6 red (reply, tool call, reasoning/reasoning_details). Not tried: across a user turn the models don't recall it on either version (DeepSeek, GLM-5.3 and Cantus answered "none"; their templates drop thinking before the last user message, as their own APIs do), so the gain is in tool loops. Cantus/Sonus get no reasoning_content_signature (magpie has none to give), and they ignored the thinking without refusing. Qoder CN not tried. |
||
|
|
1a560ba618 |
qoder 0.2.41: a chat carries the headers Qoder's client puts on a chat, not the machine id three times (#443)
unifilitence (plugins#443, Windows 11 x64, qoder.com) captured a chat
going out with the account's machine UUID as Cosy-ClientIp,
Cosy-MachineId and Cosy-MachineToken alike, Cosy-MachineType 5 and
Cosy-MachineOS x86_64_win32, and asked for each to be what Qoder's own
client sends.
Checked against Qoder.app 0.4.3: its worker runtime
(qoder-agent-sdk/dist/_worker) and the auth wasm it embeds, run here
with its own inputs:
- Cosy-MachineOS is `${x64->x86_64, arm64->aarch64, else arch}_${platform}`,
so x86_64_win32 is Qoder's own value. Only ia32 differed: the plugin
sent x86_win32, Qoder sends ia32_win32. Fixed.
- Its non-chat calls (prepareRequest) do send ClientIp, MachineId and
MachineToken all as the machine id, MachineType 5. The listing, usage
and queue status keep that set.
- A chat (prepareInferRequest, then its header pass) differs: no
Cosy-ClientIp; MachineToken and MachineType are the native device
identity's (umid runtime-info) or absent when there is none; and a
Cosy-MachineHostname, os.hostname() made safe as its zei does
(punycode, else "-" runs plus a sha256 mark, 96 chars at most). A chat
now goes so. The identity is one the check-in already read in this
process (renewed behind the chat after an hour); a chat never runs the
helper itself, so with no check-in yet it goes without, as Qoder does
when it has no identity.
- The signed payload's requestId is a dashed UUID in Qoder's signer; the
plugin sent it undashed. ideVersion "" is Qoder's own.
Left as it was: Accept-Encoding identity on a chat (Qoder sets none;
its fetch's default differs from Bun's anyway).
Run: packages/qoder `bun test` (276 pass, new headers.test.mjs and one
check-in test); `bun scripts/check.mjs` all green. Real qoder.com
account from bun in a sandbox HOME (token not renewed, no auth.set):
qfmodel answered "pong" with the new chat headers, dfmodel queued
(10605, as before), the model list 200.
Broken by hand: index.mjs at HEAD with the new tests: 6 of 7 in
headers.test.mjs and the check-in chat test red.
Not tried: Windows (the hostname and OS values are unit-tested for
it); a chat carrying a real device identity against the live service.
|
||
|
|
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
|
||
|
|
c25201d259 |
qoder 0.2.38: a reply names the model-list entry it was sent with (#413)
Qoder and Qoder CN chat replies name the model-list entry the request was built from (m.name), in JSON and every SSE chunk, usage included. A blank name, or one equal to the slot key, keeps the requested id. No extra model-list fetch per request; keys, X-Model-Key and model_config unchanged. Run at the reviewed head 6f9813f7bb44ea243007c1da2495d69de6be2de9: - bun test in packages/qoder: 266 pass, 0 fail. - model-identity.test.mjs against main's index.mjs: 28 of 28 fail; at the head they pass. - Merges cleanly onto main; npm has 0.2.37, this is 0.2.38. Not tried: a real Qoder account. Closes #412 once the reporter confirms. |
||
|
|
60b9abf2bc |
qoder 0.2.37: a QwenWork personal account's usage shows what is left, with each pool, instead of "no credits" (#385)
Cause: the public cloud's account-context answers a personal account's
quota with total and used null and only remaining (the reporter's
{"total": null, "used": null, "remaining": 2098.6336, "exceeded": false}).
parseAccountContext made a window only from total > 0, so every such
account read as "QwenWork: the account reports no credits". The usage
hook already read the account-context on site.usagePath, not Qoder's
/sash/api/v2/me/usage (that is the qoder path); the comment naming a
fetchSiteUsage that doesn't exist is corrected.
What QwenWork's own client reads, from QwenWorkCN.app 1.2.1's
app.asar out/main/main.js: fetchQuotaUsage reads
/api/v1/adapter/user/account-context?include=user,plan,quota,page,data_sharing
(unwrapAdapterResponse: the data object, else the envelope), and for a
personal account fetchUserWallets reads /api/v1/adapter/user/wallets,
taking daily_credits, monthly_credits and longterm_credits'
total_balance (mergeWalletsIntoCreditBreakdown).
Now: remaining is the card's balance, "2098.63 credits (daily 98.6 ·
long-term 2000)", with no used share made up; an account with a total
keeps its used / total window; remaining 0 or exceeded is a spent
window. The wallets are asked on the public cloud only, never for a biz
account or the enterprise flagship (the client doesn't either), and a
failed wallets read leaves the balance without pools. The envelope is
read wrapped in data or bare.
Not changed: an enterprise account on the public cloud, which the
client reads from /api/v2/quota/usage, still reads the account-context.
Run (bun 1.4.2): bun test in packages/qoder, 238 pass, 0 fail; bun
scripts/check.mjs, rc 0. The 5 new tests in qwenwork.test.mjs (built
from the reporter's bytes) fail on the old index.mjs, 14 pass 5 fail.
Probed gateway.qwenwork.cn with a bad token: wallets and
account-context answer 401, /sash/api/v2/me/usage 404.
Not tried: a real QwenWork account (none on this machine).
|
||
|
|
743e8af3b4 |
qoder 0.2.36: Anthropic's <function_calls><invoke> and Qwen's bare <function=…> calls written as text are read as calls (#323)
trae 0.2.19's sibling. qoder's Splitter read a text-written call only
inside <tool_call>, so a bare Qwen <function=compress><parameter=…> or an
Anthropic <function_calls><invoke name="…"> block (with or without the
namespace prefix) went to the agent as reply text. And parseCall
JSON-parsed every parameter, so a string parameter holding [1, 2] became
an array.
- Splitter takes the request's tools (none under tool_choice none) and
reads both shapes bare (xmlCall), only for a declared tool, never in
backticks or a code fence. A tag split across chunks is held, never
text; the closes and blanks after a call are dropped; one cut short
ends the turn with the CUT_SHORT error, as <tool_call> blocks do.
- A parameter's value is its text where the tool's schema says string,
else JSON, here and in <tool_call>'s <function=…> form.
- README says so.
Run at this commit (base origin/main
|
||
|
|
ebe3555b30 |
qoder 0.2.35: a oneOf of objects with no type reaches kmodel typed object (#378)
congee949 found that qoder-cn's kmodel_latest (Kimi K3.1 Pro) fails with 502 on dsh's REA tools because of a oneOf with no type whose branches are all objects. With "type": "object" beside each such oneOf, the same requests got 200 in a real dsh run. qoderBody now sends each tool's parameters through typedUnions, which types such a oneOf object when each branch is typed object, directly or through local $refs. Other unions, anyOf, and missing, external or circular $refs are left alone. The work is done on a copy, so the client's schema is not changed. This is the same rule workbuddy 0.1.33 applies. Run: `bun test` in packages/qoder with a sandbox HOME/TMPDIR and a dead HTTPS_PROXY: 225 pass, 0 fail. `bun scripts/check.mjs qoder`: ok. Broken by hand: with qoderBody sending parameters unchanged, schema.test.mjs goes 1 red. Not tried: a real Qoder account. |
||
|
|
3a59be3caf |
qoder 0.2.34: QwenWork (千问办公), the public cloud and the enterprise flagship (#319)
QwenWork (千问办公) is served from the qoder package as two more provider ids, as the ruling on #313/#314 asked: `qwenwork` (gateway.qwenwork.cn, the desktop client's device flow and account-context usage) and `qwenwork-enterprise` (the enterprise flagship on the enterprise's own domain, asked at sign-in or preset by QWENWORK_ENT_DOMAIN). Chat, the model list and the queue are signed for the site (ClientType 6, scene qwork, cosy 1.1.59, product qoder_work). No PAT and no check-in for QwenWork, so Qoder's desktop identity never reaches it. Qoder and Qoder CN are unchanged. Reviewed at c543f1b (on main 8d687ad; main has no qoder or registry change since), by @LittlefishStudent. Run at c543f1b, sandbox HOME and TMPDIR, network pointed at a dead proxy: - packages/qoder `bun test`: 223 pass, 0 fail. `bun scripts/check.mjs qoder`: ok. - Broken by hand, one at a time: the queue status signed without its site, 1 red; the usage 401 rotation removed, 1 red; the site's system prompt ignored, 1 red; the enterpriseHost routing removed, 6 red. - Read every call of the changed signatures (cosyHeaders, userBlob, queueStatus, queueWait, qoderBody): each passes the site, and a Qoder site has none of the new fields, so its requests are as before (the earlier review's recording probe found them byte-identical). - magpie origin/main 4dfd88206's plugin host, sandbox HOME (scripts/try.sh qoder): qoder 17 models, qoder-cn 4, qwenwork 3, qwenwork-enterprise 3. Not tried against the real API here: no QwenWork account in the sandbox. The author ran sign-in, chats and usage against a real deployment. |
||
|
|
da079585d9 |
qoder 0.2.33: a request's task name is the prompt's first ten characters, as Qoder's own client sends, not "magpie session" (#354)
business.name went upstream as "magpie session" on every request. Qoder.app
0.4.3's worker runtime (qoder-agent-sdk qoder-worker-runtime.obf.mjs) names a
task by its prompt sliced to 10 characters (the session id only for
code_review). The plugin now does the same with the task's first user
message, kept for the task's whole tool loop. Nothing old is read back from
Qoder for this field, so existing sessions are unaffected.
Run:
- no-magpie.test.mjs: qoder and qoder-cn, sessions "", "magpie-…" and
"dsh-session-1"; URL, headers, wire body and decoded body hold no
"magpie"; short, long and Chinese prompts; name kept through tool calls.
All 7 red on the old code, green now.
- bun test (package): 209 pass. bun scripts/check.mjs qoder: ok.
- Live, sandbox HOME, the owner's Qoder account (auth.set stubbed, token
not refreshed): model "efficient", 200 with a streamed reply; business
{"name":"Reply with",…}; 11 requests recorded, none naming magpie.
Not tried: qoder-cn live (no CN account).
|
||
|
|
74be6323e3 |
qoder 0.2.32: a check-in offered nothing with this device's own identity says so, and that Qoder desktop can claim it (#304)
ReneXiong (#304): on Linux ARM64 with Qoder CLI 1.1.78 signed in, the plugin read the CLI's runtime-info and sent its identity, and the campaigns list had no CLAIM_BENEFIT, while the same account and device token with the macOS desktop's identity listed a claimable 100. The check-in answered a bare { outcome: "inactive" }, with nothing saying why. Now that branch (identity read and sent, list has no CLAIM_BENEFIT) is inactive with a message: "<site> check-in: <site> offered this device's identity, read from this machine's own <site> runtime-info, no daily credits campaign right now. <site> decides per device whether to offer it; if <site> desktop shows today's credits, claim them there". It names only what the plugin knows: the identity came from this machine's runtime-info and the list offered nothing. It does not say whether the runtime was the CLI's or the desktop's, nor why Qoder offered none. Outcome is unchanged (still inactive), so magpie's day logic is the same. "no campaigns page for this account" and the ineligible/failed paths are unchanged. Run: TMPDIR=<scratch> HOME=<scratch>/h bun test packages/qoder: 202 pass, 0 fail (native-checkin.test.mjs: one test rewritten, one CN test new). Repo root, same sandbox: 2381 pass, 0 fail. bun scripts/check.mjs qoder ok. Broken by hand: with origin/main's index.mjs both tests are red (message undefined). Not tried: a real Qoder account; the wording is from the code path, not a live answer. |
||
|
|
421117ef75 |
qoder 0.2.31: every call of one prompt's tool loop goes out as one task, as Qoder's client sends it, under the agent's own session (#330)
real-jacket (#330): one DSH task on qoder/dfmodel made 265 calls in 55 minutes, then Qoder answered 429 "Billing daily count exceeded". qoderBody made every call a task of its own: request_set_id = chat_record_id = request_id, a new business.id, begin_at = the call's own time and stage "start" on every call. What Qoder's client does, read (read-only) from the installed Qoder.app's qoder-agent-sdk worker (dist/_worker/qoder-worker-runtime.obf.mjs): - AgentLifecycle.create runs once per user prompt (driveQuery), with requestSetId = the prompt's requestSetId, else a preallocated one, else randomUUID(); business = {product, version, type, id: the prompt's requestSetId || randomUUID(), name, begin_at: Date.now(), stage: "init"}. - changeBusinessState() moves init -> "start" right after create, so the first call goes with "start", and start -> "processing" after each answered call (it runs after the error check of a model reply). - The chat body per call: request_id = chat_record_id = a new id, request_set_id = the lifecycle's requestSetId, business = the lifecycle's businessInfo. A retry renews request_id/chat_record_id only. The plugin now keeps a task per session and last user turn (taskOf): one UUID for request_set_id and business.id, one begin_at, stage "start" until a call of it is answered, "processing" after; request_id/chat_record_id stay new per call. A new user prompt is a new task. Tasks are an LRU map held to 512 entries, each dropped 2h after its last call. session_id: the plugin now has a chat.headers hook (as cursor and trae do) that passes the session magpie hands it (provider.ConversationHeader, which is DSH's x-deepseek-harness-session-id when DSH sends it, or another agent's own session header; OpenCode's session in OpenCode) to its fetch in x-magpie-qoder-session, which never goes to Qoder. session_id is its hash; magpie's "magpie-<hash>" fallback names no session and the old hash (prompt_cache_key, user, system + first user turn) stays the fallback, so a DSH system prompt changing mid-task (yetone/magpie#3298) no longer splits the session. The hook acts on its own site's provider only. Run: in packages/qoder, TMPDIR=$H HOME=$H/home bun test: 201 pass, 0 fail (task.test.mjs 6 new). Repo root, same sandbox: 2311 pass, 0 fail. bun scripts/check.mjs qoder ok. Broken by hand, task.test.mjs red each time: per-call request_set_id/business.id/begin_at (2 red), session_id ignoring the named session (2), stage always "start" (2), no LRU/TTL eviction (1), the hook unscoped to its provider (1); on origin/main's index.mjs all 6 are red. Not tried: a real Qoder account (none used) or a capture of the official client's wire bytes. Whether Qoder's "Billing daily count" counts by business.id / request_set_id is not known: the change makes the calls look as the official client's do, it does not prove the count drops. Not changed: Qoder's client also reports the end of its prompt to /api/v2/service/ask/finish and sends a shorter model_config; the plugin still doesn't. |
||
|
|
929a8b3adf |
qoder 0.2.30: Qoder CN's check-in sends Qoder CN's own device identity, as its desktop and CLI do (yetone/magpie#2911, #304)
witt-bit (yetone/magpie#2911, 10-22): after Qoder CN's update moved its
daily 100 Credits into the desktop's 权益中心, magpie's Qoder CN check-in
stopped working; Andrew0767 (#304) sees the same with Qoder desktop
installed. The plugin sent Qoder CN's campaigns pages no device identity
at all ("Qoder CN does not need this local helper").
What Qoder CN's clients do, read from their own packages:
- Qoder CN desktop 0.4.9 (the .deb's out/main): its requests carry
Cosy-ClientType 10 and, through createAuthorizedHeaders, the identity
from <resources>/umid/runtime-info run with environment
`regionCode === "global" ? 3 : 0`, i.e. 0 for Qoder CN, the uid on
stdin (--account-stdin) on macOS and Windows. Campaigns are found
through GET /sash/api/v1/me/notifications (hasClaimableCampaign,
campaignPopupUrl). When the identity can't be read it sends the
request without it (resolveMachineIdentity's catch returns null).
- qoderclicn (@qodercn-ai/qoderclicn 1.1.64, 1.1.70, 1.1.73):
campaigns.list is GET /sash/api/v1/me/campaigns, needing the UMID from
1.1.64 and requireMachineIdentity() from 1.1.70, UMID environment
ONLINE = 0; its config dir is QODERCN_CONFIG_DIR, else QODERCN_CLI_HOME
(or home) + QODERCN_CONFIG_DIR_NAME (or .qoder-cn), and it caches the
helper in <config>/.bin/runtime-info-<platform>-<arch>-<hash>.
- Install places: Qoder CN.app/Contents/Resources/umid/runtime-info
(seen inside Qoder-CN-Installer-mac-arm64.zip's payload, 0.4.9),
/opt/Qoder-CN/resources/umid/runtime-info (the .deb), and on Windows
umid/runtime-info.exe among Qoder-CN-win-x64-user.exe's owned files,
with "Uninstall Qoder CN.exe" (electron-builder's
%LOCALAPPDATA%\Programs\<productName>; the folder itself not seen).
The plugin now keeps a runtime per site (RUNTIMES): Qoder CN reads its own
helper (those paths, its CLI's folders, QODERCN_RUNTIME_INFO, never the
international Qoder's) with environment 0, and sends Cosy-MachineToken and
Cosy-MachineType on the list, the claim and the campaigns proxy. As the
desktop does, a Qoder CN request without a readable identity still goes
out, so an account that was claiming without Qoder CN installed (0.2.21's
live PAT claim) keeps doing so. When such a list offers no daily claim,
the check-in is ineligible for the day, saying to install Qoder CN desktop
or sign in to its CLI (no helper), or failed and asked again (a helper that
didn't answer), instead of "inactive". International Qoder is unchanged.
Run: in packages/qoder, TMPDIR=$H HOME=$H/home bun test: 195 pass, 0 fail.
On the old index.mjs the new tests are 9 red (checkin.test.mjs 5 lookup
tests and the env-0 proxy test, native-checkin.test.mjs the env-0 claim,
the ineligible and the failed cases). Repo root at this commit
(rebased on
|
||
|
|
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
|
||
|
|
6219a7115a |
qoder 0.2.27: no Qoder on the machine is an ineligible check-in that says what to do once (#304)
On a machine that never had Qoder desktop or Qoder CLI, the international
daily check-in failed with "device identity runtime not found" and magpie
showed "签到失败,magpie 稍后重试", asking again every 30 minutes all day.
It can't succeed: Qoder lists the daily CLAIM_BENEFIT only on a request
carrying Cosy-MachineToken/Cosy-MachineType, and those come from Qoder's
own signed runtime-info helper (#49 showed the list without them has no
claim). The plugin never computes or invents that identity, so without
the helper there is nothing to send.
What changed:
- campaignRuntime throws RuntimeMissing when no helper is found anywhere;
auth.checkin answers it with outcome "ineligible" (settled for the
Beijing day by magpie, asked again the next day) and a message that says
to install Qoder desktop, or install Qoder CLI and sign in once, or set
QODER_RUNTIME_INFO. "ineligible" is the plugin hook word Trae's 9074
already uses for "check in in the vendor's app"; own-app is not a hook
outcome (magpie's provider-plugins.md).
- A helper that exists but fails or gives an invalid identity is still
"failed" and retried. The fetch path (campaign) keeps its 502, now with
the clearer message. Qoder CN is unchanged (it needs no helper).
- README: the daily check-in section says the above.
What was run (at
|
||
|
|
dc59000b1b |
qoder 0.2.26: mark the prompt for Qoder's cache as its client does (#290), and find a machine-wide Windows install's runtime-info
#290 (Codex side session on Ultimate read 0% from cache). Qoder's own
client (qoder-agent-sdk in Qoder.app 0.4.3, qodercli 1.1.75) sends, on
every agent_chat_generation request:
- cache_control {type: ephemeral} on the last non-thinking, non-tool
block of the last message when it is a user turn (none when the last
turn is tool results);
- each user turn's blocks as `contents` beside `content`;
- request_id / chat_record_id / request_set_id per request and a stable
session_id per conversation.
The plugin sent none of that, and gave a tool call without an id a new
random id on each request, so the prefix changed every turn. Now:
- cacheMarked() marks as above, without touching the caller's turns;
- session_id is a UUID-shaped sha256 of prompt_cache_key (Codex's
thread, which magpie forwards) or else of the system text and first
user turn; the key itself never goes out;
- an id-less call's id is sha256(turn, place, name, arguments).
Check-in (accomplish on Discord, 10-21: Qoder intl can't check in, CN
can). Only the international site needs Qoder's runtime-info helper;
on Windows only %LOCALAPPDATA%\Programs\Qoder was searched. A
machine-wide install under %ProgramFiles%\Qoder is now found too. This
is one possible cause, not a confirmed one: the reporter's error text
and OS are unknown.
Run at this tree (rebased on
|
||
|
|
f5548bd5ca |
qoder 0.2.25: qoder.com's sign-in sends no redirect_uri, so Qoder.app isn't handed the page (#276)
SITES.qoder asked qoder.com's device page for redirect_uri=qoder-app://, the desktop app's own scheme (Qoder.app's Info.plist registers qoder and qoder-app). On a Mac with Qoder.app installed the page's last hop opened the desktop app instead of staying in the tab, while the plugin polls openapi.qoder.sh for the device token and needs no callback at all. Qoder's own clients treat the parameter as optional: Qoder.app's app.asar adds redirect_uri only when its config has one (authRedirectUris: stable qoder-app://, canary qoder-canary://), and Qoder's CLI (@qoder-ai/qodercli 1.1.75, bundle/qodercli.js) builds /device/selectAccounts from challenge, challenge_method, nonce, machine_id and client_id alone, then polls /api/v1/deviceToken/poll. qoder.com now gets the same: no redirect_uri, as qoder-cn already does. cn.test.mjs's "qoder.com's sign-in is as it was" pinned the bug (redirect_uri == qoder-app://); it now checks there is none. Run: - packages/qoder: HOME=<scratch> bun test: 167 pass, 0 fail. - Broke it by hand (redirect back to "qoder-app://"): the #276 test in cn.test.mjs fails (Expected false, Received true), 11 pass 1 fail. - Repo root, as CI: TMPDIR=<scratch> HOME=<scratch>/home2 bun test: 1919 pass, 1 skip, 0 fail across 173 files; bun scripts/check.mjs ok. Not tried against a real Qoder account here. The reporter (asuan-dev) says the same one-line change on 0.2.21 signed in three accounts and left the page on "Sign in success". |