32d58dd511c9336ac082bdf29d5c758db85406c4
59
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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". |
||
|
|
4af310cc57 |
qoder 0.2.24: Qoder's 400 "Error in upstream response" is a 502, so magpie retries or falls back (SlouchyQuill507 on Discord)
SlouchyQuill507 (Discord, qoder-cn) reported Qoder failures of the model's
own vendor, "Error in upstream response", reaching magpie as a 400 invalid
request: the client's fault, never asked again or of another account.
failure() now maps a message saying "Error in upstream response" to a 502
(no X-Magpie-Sign-In, the account untouched), after the queue, quota and
request codes, so a 400 with one of Qoder's request codes (406, 416, ...)
and any other 400 stay 400. It covers an HTTP 400 and a 400 in the
stream's statusCodeValue envelope, JSON or plain text. magpie still tells
an overflow that fails this way apart by its size (tooLongUnsaid takes 502
as well as 400).
Test: usage.test.mjs "Qoder's 400 \"Error in upstream response\" is a
502" - fixtures from the reported literal text, four shapes through the
loader's fetch, plus genuine 400s kept. Red on the old index.mjs (400 for
each), green with the change.
Run on origin/main
|
||
|
|
d41a074ba3 |
qoder 0.2.23: Cosy-Version claims the desktop app's worker runtime, 1.1.69 (#281)
Run on origin/main
|
||
|
|
a900bab104 |
qoder 0.2.22: a tool result whose call lost its id answers that call, not an orphan (#277, #278)
Run on origin/main
|
||
|
|
0a8e5abd00 |
qoder 0.2.21: Qoder CN PAT sign-in, and a PAT account checks in on its job token (#262, sphuang1030-prog)
Qoder CN offers the PAT sign-in too (its /api/v1/jobToken/exchange takes a personal_token as qoder.com's does; the prompt names qoder.cn's console), and a PAT account, which has no device token, signs the campaigns pages and the daily check-in with its job token instead of rotating a device token it doesn't have. The account keeps the name its browser sign-in takes (email || uid), so a renewed PAT sign-in replaces its lapsed row. Run at d7db9f2b987c46cbf100cda9d89a8a546e374fb6: - bun test packages/qoder: 155 pass, 0 fail; bun scripts/check.mjs passes. - The PR's check-in tests go through the loader's campaigns fetch, not auth.checkin. Two local tests calling auth.checkin with a PAT account (qoder and qoder-cn: claimed on the job token, no deviceToken refresh; a 403 is "failed", not rotated) pass on this head and both fail with the checkin hook's change reverted by hand. They follow on main. - Probe: POST openapi.qoder.com.cn/api/v1/jobToken/exchange with an invalid pt- token answers 400 BadRequest, as openapi.qoder.sh does (an unknown path answers 401), so the endpoint exists on CN and a bad PAT maps to "refused the PAT". qoder.cn/account/integrations redirects to sign-in, as qoder.com's does. - Not tried: a live qoder.cn PAT exchange, chat or claim; that rests on the author's live run. |
||
|
|
915f14324e |
qoder 0.2.20: keep unnamed native tool deltas out of history (#256, Euraxluo)
A Qoder reply's native tool-call deltas no longer become a tool with an empty name. An empty or null placeholder is skipped; an id or arguments that arrive before the name are held until it comes; each upstream index keeps its own output index, so interleaved parallel calls get their own arguments (streamed and non-streamed). A native call that ends without a name ends the turn as a 502 instead of being sent on, since clients persist the empty name and Responses providers then reject the history. Qoder and Qoder CN share this parser.
Run at the reviewed head 9c755fd62cfd11cb80a9d960862aad25c32fb97d:
- bun test packages/qoder: 150 pass, 0 fail
- bun scripts/check.mjs qoder: ok
- native-tools.test.mjs on origin/main
|
||
|
|
3edbb18510 |
qoder 0.2.19: a model list that can't be read is a 502, so magpie falls back (#249)
A failed read of Qoder's model list during a chat (DNS, timeout, an HTTP
refusal) now answers 502 instead of 400, so magpie retries and falls back to
the next member of a group instead of ending the request. A lapsed sign-in
met on that read answers 401 with the sign-in mark, as the chat path does.
Run at the reviewed head fcdf173e1 (on origin/main
|
||
|
|
c397e96b77 |
qoder 0.2.18: a trimmed or wrapped 10605 is busy, not a lapsed sign-in
Releases #185. Run at this head: bun test packages/qoder: 138 pass, 0 fail; bun scripts/check.mjs qoder: ok; git diff --check clean. |
||
|
|
5d7fb87f84 |
qoder 0.2.17: native daily check-in through auth.checkin (#179)
Adds auth.checkin to Qoder and Qoder CN. It lists the account's campaigns and claims a CLAIMABLE CLAIM_BENEFIT campaign, and the list and the claim go through the plugin's own campaigns path: device token, one rotation on 401/403, VPC host and native machine identity. The outcomes match magpie's built-in qoder_checkin.go: - a CLAIMED campaign is done only while its startAt/endAt window is open; - a daily campaign that is neither claimable nor active-claimed is failed, so it is asked again later; - no daily campaign at all is inactive; - a list or claim reply that can't be read is failed, never inactive or claimed. The credit is the claim's own benefit.amount, else the campaign's. Bumps the package to 0.2.17. Reviewed head 128ed2a. Ran at that head: - bun test in packages/qoder, sandbox HOME/TMPDIR: 127 pass, 0 fail - git merge-tree onto origin/main: clean - PR CI: test and on-npm pass - read every line of the checkin hook against magpie's internal/provider/qoder_checkin.go. The campaign shape and its seconds-based startAt/endAt match the real campaign JSON in qoder_checkin_test.go. |
||
|
|
5d5d86e225 |
qoder 0.2.16: a tool call written into the text that can't be read, or that the stream ends inside, ends the turn as an error, never as the answer (#132)
A <tool_call> block whose JSON wasn't whole ({"path":}) was reprinted as
text, and one the stream ended inside was flushed as text; either way the
turn finished "stop" with a 200, the call lost and nothing to fail over on.
Mirrors trae since 0.2.5 (#38): a block on its way to being a call (its
content starts with "{" or holds "<function=") that can't be read, or is
cut short at the end, ends the turn as an error: the stream with the error
frame and no finish, a request not streamed (or one with nothing before the
block) a 502. A block whose JSON (or XML function) is whole when the stream
ends without its close is still the call. A tag in a code fence or inline
code, or one that isn't call-shaped (<tool_call>incomplete), stays text.
Siblings: only trae (already fixed) and qoder parse calls out of the text;
grep for tool_call/function=/invoke/DSML across packages/*/index.mjs finds
no other parser.
Run at this head:
- textcall.test.mjs (new, the issue's literal frames: closed with bad JSON,
stream ends inside, readable control, whole JSON without its close, XML
form, look-alike text; streamed whole and 3 chars per frame, and not
streamed): 7 of 9 red on the 0.2.15 code (the control and look-alike
tests passed there), all green after.
- packages/qoder: 118 pass, 0 fail.
- Whole repo as CI runs it: HOME/TMPDIR in a scratch dir, bun test:
1320 pass, 0 fail; bun scripts/check.mjs: ok.
Not tried against a real Qoder account; the frames are the reporter's.
|
||
|
|
a6f09a0e9a |
qoder: add PAT (Personal Access Token) sign-in method (#103)
* qoder: add PAT (Personal Access Token) sign-in method
Add a new auth method that exchanges a PAT for a job token via
/api/v1/jobToken/exchange, bypassing the OAuth device flow. PATs are
long-lived (up to 1 year), avoiding the ~3-day re-authentication cycle
of OAuth refresh tokens.
Changes:
- Add patSignIn function for PAT → job token exchange
- Add "Sign in with Qoder PAT" method with password prompt
- Handle PAT accounts in usage (no device token available)
- Add pat.test.mjs with 10 tests covering both sites
- Update vpc.test.mjs for new method count
* qoder: use text prompt type for PAT (magpie has no password type)
magpie's prompt system only supports "text" and "select" types.
Change the PAT prompt from "password" to "text" to match.
* qoder: use password prompt type for PAT input
Now that magpie supports "password" prompt type, use it for PAT input
so the token is masked when typed in both GUI and TUI.
* qoder: address PR review — PAT kept, fields read as Qoder's client does
1. Store the PAT on the credential; when the job refresh lapses
(SignInGone from refreshJob), re-exchange the PAT instead of
marking the account signed out. The PAT lasts a year, the refresh
two days.
2. Read the exchange response as Qoder's client does:
- token from token, device_token or access_token
- refresh from refresh_token or refreshToken
- expiry from expire_time or expires_at (date) first, then
expires_in in seconds (not milliseconds)
3. Use the openapi() helper for the exchange (no custom User-Agent);
400/401/403 say "refused the PAT" rather than passing through the
raw body.
4. Try the usage endpoint with the job token for PAT accounts; fall
back to the "PAT" plan label if it won't accept it.
5. Exclude the PAT method from Qoder CN: its CLI uses device chat
directly and never makes a job token, so a PAT exchange may not
produce one the chat endpoint accepts.
* qoder: fix expires_in unit — milliseconds, not seconds
The real exchange response shows expires_in: 86400000 (24h in ms),
not 86400 (seconds). The expires_at date field takes precedence in
exchangeExpiry, so the fallback was not hit in practice, but correct
it for completeness.
* qoder: drive the renew test through the real refresh path, usage through fetchUsage
The renew test called the PAT sign-in directly, so it never met the
fallback it was named for. It now loads a stored expired credential
whose job refresh is refused, and checks the exchange is asked with the
stored PAT, the request goes on with the new token, and the saved
credential still carries the PAT — and fails when the fallback is
taken out. A second case keeps no PAT on the credential and expects
the sign-in gone to come out.
The PAT branch of usage built fetchUsage's request by hand and turned
every error into a plan of its own; it calls fetchUsage now, its
errors surfacing as the device path's do. A live PAT account answered
the usage endpoint 200 with a qoder envelope on the job token from the
exchange, said so in the comment there.
* qoder: a refused PAT re-exchange ends the sign-in
The renew fallback let a refused PAT through as a plain error, which
magpie read as a server fault and kept the account on. A PAT lapses
like a device sign-in does — expired, or revoked — so renew turns the
exchange's refusal into a lapsed sign-in: usage says "expired" and the
request answers 401, asking for a new PAT. Interactive sign-in keeps
the plain error.
|
||
|
|
f573cfdcba |
qoder: Qoder's queue (code 10605) is a 503 to retry after its wait, not a lapsed sign-in (#98); 0.2.14
failure() turned every 401/403 into "the sign-in lapsed — sign in again".
Qoder answered every chat on a real trial account (2026-10-12) with
403 {"code":"10605","message":"{...\"retryAfterSeconds\":30,
\"serviceAvailable\":false...}"}: its queue for the model, while the same
token read the models and usage.
Codes are now read as Qoder's own client reads them (the QoderErrorCode
table in Qoder.app's qoder-agent-sdk worker), whatever the HTTP status:
- 10605, or a queue state with isQueued or serviceAvailable false: 503
with Retry-After from retryAfterSeconds (30 when absent), no
X-Magpie-Sign-In. magpie's gateway counts a 503 as busy and asks again
after Retry-After (patience.go busy/noteBusy).
- 110, 112-119, 122 (usage/credits used up): 429.
- 406, 416, 430, 80411, 80412, 100400-100403 (refusals of the request): 400.
- 105 (loginExpired) or no code: the 401 as before.
Both the HTTP status path and the in-stream statusCodeValue path go
through failure(); errorResponse sends Retry-After.
Run: bun test (sandbox HOME) 1137 pass 0 fail; bun scripts/check.mjs ok.
busy.test.mjs uses the literal body as testdata; its 4 tests all fail
against the previous index.mjs and pass with this one. Not tried: a real
10605 after the change (the account's queue was open again by then: a
real chat on fast answered "ok"); the quota and request codes' HTTP
status from Qoder is not seen, only their meaning from Qoder's client.
|
||
|
|
04e188aaec |
qoder 0.2.13: an account lists the models Qoder's app shows, Fast (0.8×) among them, and keeps Performance (#97)
Qoder's model listing (/algo/api/v2/model/list) has a list per scene. The plugin read only "chat", while its requests are sent as Qoder's app (product and session_type "app"). On 2026-10-12 the app scene lists Fast (key fast, 0.8×) where chat still lists Performance (1.1×), so magpie showed Performance and never Fast, which Qoder's app shows (yygutn, #97). The models hook now lists the app scene in its order and adds each model only chat still lists after the model it follows there, so a pick of Performance stays served. Each key once; the app's entry wins. A listing with one scene gives that one. New app models show from the account's own listing without a plugin release. The fallback list gains Fast. Verified: - The real listing read through the plugin on the owner's Qoder account (sandbox HOME, credential copied in memory, nothing written, no token renewed): fast "Fast" rate 0.8 and performance rate 1.1 both listed. - models.test.mjs runs on that real listing (testdata/listing.json, the chat and app scenes); all 4 tests fail with modelInfos put back to listing.chat, and pass with the change. - bun test (sandbox HOME/TMPDIR): 1133 pass, 0 fail. bun scripts/check.mjs ok. Not verified: a real chat on fast. Every model on that account (fast, performance, efficient, qfmodel) was refused with 403 code 10605 (serviceAvailable false, queueType p3, retryAfterSeconds 30) though the trial has 143/300 credits; the plugin reports that as a lapsed sign-in, filed separately. Qoder CN's listing wasn't read (no CN account). |
||
|
|
aa2d99bd13 |
qoder 0.2.12: a chat Qoder refuses (401/403) keeps Qoder's own reason in the error
Yayoi_no_yume on X: a request made right after signing in came back "Qoder: the sign-in lapsed — sign in again" (401), and only installing and signing in to Qoder CLI made it work. failure() replaced whatever Qoder said with that fixed text, so the real reason for the refusal could not be seen. The message is the same, with "(Qoder said <status>: <its message>)" added when Qoder gave one; the account is still left unmarked (X-Magpie-Sign-In: kept), as before. usage.test.mjs gains the case (a 401 whose body says why); it fails on 0.2.11 and passes. bun test (89 pass) and scripts/check.mjs qoder under a scratch HOME pass. Not tried against Qoder itself (no Qoder account here), so the cause of the reporter's 401 is not known yet. |
||
|
|
d21d10f0da |
qoder 0.2.11: isolate VPC account state (#40)
Co-authored-by: 尤贺雨 <youheyu@sungrowpower.com> |
||
|
|
5e80f39d3f |
qoder 0.2.10: international check-in finds Qoder's device identity runtime where Qoder CLI and the Linux desktop really keep it (ARNO on Discord: "device identity runtime not found")
0.2.9 (#49) looked for the CLI's cached runtime in ~/.qoder/.bin/umid-<platform>-<arch>-*/ on every platform. qodercli 1.1.66 (npm) and the worker in Qoder desktop 0.4.3 (extractBinary) make that folder only on Windows (umid-win32-<arch>-<hash>\runtime-info.exe with sgsdk.dll); on macOS and Linux they write a file, ~/.qoder/.bin/runtime-info-<platform>-<arch>-<hash>. And the Linux desktop installs to /opt/Qoder/resources/umid/runtime-info (Qoder 0.4.3's .deb and .rpm), which wasn't looked at. So a macOS user with only the CLI, and every Linux user, got HTTP 502 on the international check-in, while Qoder CN (which needs no runtime) checked in. campaignRuntime now looks at /opt/Qoder on Linux, reads the CLI's cache as the CLI writes it (the newest matching file, a .tmp being written skipped), and follows the CLI's own folder settings (QODER_CONFIG_DIR, QODER_CLI_HOME, QODER_CONFIG_DIR_NAME). Windows and macOS desktop lookup is unchanged. checkin.test.mjs lays out the CLI cache as qodercli writes it on win32/x64, darwin arm64/x64 and linux x64/arm64, plus /opt/Qoder and the config-folder variables: 6 of the new tests fail on 0.2.9 (the Windows case passes on both, as 0.2.9 had it right), all pass now. bun test packages/qoder (87 pass) and scripts/check.mjs qoder under a temp HOME pass. On this Mac the real lookup returns /Applications/Qoder.app/Contents/Resources/umid/runtime-info. Not run: the runtime itself against a real account, or on Linux/Windows. |
||
|
|
972c0a9f81 |
qoder 0.2.9: international check-in sees the daily 100 credits (yetone/magpie#1268, #49)
Releases #49: international campaign requests carry Qoder's native device identity (Cosy-MachineToken, Cosy-MachineType) from its own runtime-info helper, as Qoder.app 0.4.3 does. Without it Qoder answers 200 with only VIEW_DETAILS. Verified with a real international account (GET only, no claim): CLAIM_BENEFIT/CLAIMABLE/100 with the identity, VIEW_DETAILS only without. bun test packages/qoder: 82 pass; check.mjs qoder passes. |
||
|
|
ecca97cadd |
qoder 0.2.8: Qoder CN enterprise VPC sign-in (yetone/magpie#312) (#41)
A new method, Sign in with Qoder CN Enterprise (VPC), asks for the instance (its name or <instance>.vpc.qoder.com.cn) and serves the account from the instance's own hosts: <i>.vpc.qoder.com.cn for the sign-in page, <i>-openapi.vpc.qoder.com.cn for poll, tokens, user info and usage, and <i>-gateway.vpc.qoder.com.cn for models and chat, the paths unchanged, as @qodercn-ai/qoderclicn 1.1.64 rewrites the public origins once a VPC instance is set. The instance is kept on the account; an account with none is served as before, and one with an instance that names none is asked to sign in again rather than sent to the public hosts. Not tried with a real VPC account. vpc.test.mjs builds its fixtures from AwadYoo's redacted shapes on #312; 12 of its 13 tests fail on 0.2.7 (the one that passes is the public sign-in staying as it was). bun test packages/qoder: 67 pass; HOME=$(mktemp -d) bun test: 864 pass; bun scripts/check.mjs: all pass. |
||
|
|
72382fb8a1 | qoder 0.2.7: the account's fetch sends Qoder's campaigns pages (the daily credits claim) as the account — GET <openapi>/sash/api/v1/me/campaigns and POST …/{id}/claim, on the device token as usage is read (a refused one rotated once), for qoder (openapi.qoder.sh) and qoder-cn (openapi.qoder.com.cn); any other page there is still refused. For magpie's Qoder check-in (Discord, ARNO, after wallechfox/qoder-checkin). checkin.test.mjs is new (4 of its 5 fail on 0.2.6); bun test (54 pass) and check.mjs qoder pass. Not tried against Qoder itself (no Qoder account here). | ||
|
|
a839119751 | qoder 0.2.6: the window a request is sent holds the reply's max_tokens too (yetone/magpie#700 follow-up, kyzhouxu: a group's DeepSeek V4.1 Flash refused near 207K until Qoder's DeepSeek-Flash was taken out of it) — since 0.2.5 windowFor sends the model's default window (200K on the models context_config lists 200K/400K/1M for) while the request's estimate, a token per 3 bytes of its messages and tools, fits it, and asked for nothing of the reply: a 180K conversation with the 32000 max_tokens Qoder is sent went out with context_length 200000, which a prompt plus reply past 200K overflows, while magpie and the agents behind it are told the model takes 1M. The estimate now adds the reply's max_tokens (what qoderBody sends), so that request is sent 400K; a short one still gets the default window. Qoder's own metadata does say 1M for dfmodel: its live listing's max_input_tokens was 1000000 (the context 0.2.4 cached for it in a sandbox magpie on 2026-10-03, where MiniMax-M3 read 180000) and 0.2.5 reads 1M as its largest window, and docs.qoder.com/cli/model lists DeepSeek-V4-Flash with 200K / 400K / 1M, so the reported context stays 1M. When kyzhouxu's refusal happened isn't known: #700 itself (ynky007) was opened before 0.2.5, when every request was sent context_length 1000000, and their comment came after it (2026-10-04 03:34 UTC), so this is the way 0.2.5 can refuse a request under the window magpie reports, not shown to be what they hit. context.test.mjs gains the case (180K prompt: 200K with max_tokens 1000, 400K with 32000 and with none asked); it fails on 0.2.5 (200000) and passes; bun test (49 pass) and bun scripts/check.mjs qoder under a temp HOME pass. Not tried with a real Qoder account. | ||
|
|
a5f3321af3 | qoder 0.2.5: a model's context is the largest window Qoder offers it, not max_input_tokens (yetone/magpie#722, Moody-Sin: qoder 的 qwen 3.8 flash 只有180K上下文) — modelInfo took the context from max_input_tokens, 180000 on Qwen3.8-Flash (and Qwen3.8-Max, Kimi-K3, GLM-5.3, MiniMax-M3, Sonus, Cantus), so magpie and every agent behind it were told 180K, and each request was sent context_length 180000. Qoder's client reads the windows a model offers from the listing's context_config ({name: {token_count, is_default}}; else available_context_windows / default_context_window), as qodercli's catalog does (YT/Yai in the Qoder.app 0.4.3 worker), and its Context setting offers 200K, 400K and 1M on Qwen3.8-Flash and twelve others (docs.qoder.com, model tier selector); max_input_tokens is only what a request naming no window gets. windowsOf reads them the same way; a model's context is now its largest window (max_input_tokens when it lists none), and windowFor sends the default window while the request fits it, else the smallest that holds it, else the largest — a larger window may change the rate, Qoder's docs say, so it is asked for only when the conversation needs it; the request is counted generously, a token per 3 bytes of its JSON. context.test.mjs (windows read from context_config and available_context_windows, a model without them keeping 180000, the default window sent for a short request and 400K/1M for longer ones) fails on the old code and passes; bun test (48 pass) and scripts/check.mjs qoder under a temp HOME pass. Not tried with a real Qoder account: the listing's context_config for qfmodel is read from Qoder's client code and docs, not from a live listing. | ||
|
|
bf7ced3156 | qoder 0.2.4: Qoder's token usage is read — it comes in a chunk of its own after the finish, with no choices, and the stream was read only up to the finish, so every request through the plugin was counted as 0 tokens (found testing a real qmodel account: prompt_tokens 0 on every reply). events() now reads to [DONE], keeps the finish reason, and takes the usage, cached and reasoning tokens included, from whichever chunk carries it, as the built-in did (qoder.go). stream.test.mjs, a reply shaped as a real one, fails on the old code and passes. Tried with a real Qoder account in a sandbox magpie: chat, streamed chat and an Anthropic tool call all report their tokens (40 in / 120 out, 107 reasoning; 298 / 86 with the tool). | ||
|
|
39d9cffe7d |
qoder 0.2.3: magpie renews the sign-in ahead of time through auth.refresh
auth.refresh with refreshLead 10 minutes (in-fetch: 5) for qoder and qoder-cn: the job token through refreshJob, or a qoder-cn device-token chat through refreshDevice (both pairs given). Under the request path's lock; a spent map lets a request holding the old pair use the new one. 401/403 is signIn "expired" as on the request path; anything else is retried. The check before each request stays for OpenCode, which doesn't call the hook (magpie 0.1.684+ does). refresh.test.mjs fails without the change; HOME=$(mktemp -d) bun test passes (396 across the repo). |