sept13-yu's bisect on #709 (2026-11-05): with the plugin's own headers
and body ({"req_source":1}), the same token and account, seconds apart,
only x-device-id changed, the account's own 16-digit id got 9074 and a
15-digit one (a random, never-registered one too) was taken. Three
accounts, two machines on two ISPs, magpie's headers and wild-work's
alike: 16 refused every time, 15 taken every time. Every account signed
in since 0.2.16 has a 16-digit id and ugDevice sent it as it was, so
every client-less account's first claim got 9074. 0.2.29's second claim
uses trae-mate's 15-digit uid-derived id, which is likely why it lands.
ugDevice (only used for the ug pages, status and claim, of a trae-cn
account no local client is signed in as) now keeps an id that is
already 15 digits and otherwise makes a 15-digit one from the account's
own device id and uid: the same derivation it used for pre-0.2.16
19-digit ids, now modulo 9e14 with a 1e14 floor, so the first digit is
never 0 (shapeDevice can start with 0, which as a number is 14 digits).
Stable per account, changes only with a new sign-in, never another
account's.
Left alone, and why:
- newDevice stays 16 digits. That id is registered at sign-in, sent on
every chat request and bound into the renewed JWT; nothing measured
says chat or renewal want 15, and the bisect showed registration
doesn't matter for the claim.
- An account whose local Trae CN client is signed in as it keeps the
client's own device (the bisect didn't touch that path).
- Trae Global: no check-in, 19 digits as before.
- 0.2.29's one extra claim in clientShapeHeaders after a 9074 stays as
the fallback: the bisect never sent that request with a 16-digit id,
so "nothing but the id matters in it" isn't measured. It costs one
claim on a 9074 day only.
Run (mote, bun): packages/trae bun test, 240 pass 0 fail; bun
scripts/check.mjs, 44 packages ok.
Broken by hand: the old index.mjs under the new tests on mote, 11 red,
among them the new "signed in since 0.2.16 (16 digits) checks in on a
15-digit id" test and the request-header tests. Golden ids
(166487253502651, 245914665436526) worked out by a separate Python port
of the derivation, which also reproduces the old 2866487253502651.
Not tried: a real Trae CN account check-in (no account here); whether
the chat or renewal care about the id length.
With no Trae CN client on the machine, Trae CN answers the plugin's
check-in claim 9074 every day (#722: jiabaoyu, never once taken; #709:
two accounts on a headless box). The same accounts check in through
tools that also have no client: providers-hub daily (#722), wild-work
(#709). #709 first put this down to account-level rate limiting cleared
by wild-work's 8s retry, but its reporter's own log then showed every
wild-work claim taken first time (~100ms, no 9074 since 09-19), so the
retry never ran and waiting is not the difference. What the working
tools share and the plugin doesn't: body {}, x-user-region: CN, a
15-digit id, no Electron UA / 0.1.69, none of the IDE's device headers.
providers-hub sends luckymiaow/trae-mate's request (MIT): those headers
and an id made from the uid alone, never registered at a sign-in.
Now an account no client here is signed in as gets one more claim, at
once, after a 9074, in trae-mate's request as it is (clientShapeHeaders;
its device, market user and session ids from the uid). Once: a second
9074 is the day's answer; no other code is claimed again; an account
that rode its own client's device is not; an account with no uid is
not. The first claim is unchanged, so an account it already works for
sends nothing new. Which single field Trae CN wants is still #709's
bisect.
Run (mote, bun): packages/trae bun test, 239 pass 0 fail; bun
scripts/check.mjs, every package ok.
Broken by hand: the old index.mjs under the new tests, 5 red (the
claimed-once-more, two-claims-never-three, and three message/device
tests); the guard widened to any non-zero code, "only a 9074 is claimed
again" and the 9095 test red. The golden ids for uid u-1 were worked out
with a separate Python port of trae-mate's device_map.rs.
Not tried: a real Trae CN account (no account used); whether the whole
request or one field of it is what Trae CN takes.
moxuanchen (plugins#436, Windows 11, TRAE CN 3.4.4, plugin 0.2.24):
account A checked in (100 credits), account B got 9074. Learning why
took running clientDevice by hand: both of that machine's profiles
(Trae CN, TRAE SOLO CN) were signed in as A with one device, so B's
claim went on magpie's own device for it.
The 9074 and 9095 messages now end with the device the claim went on:
this machine's client's, signed in as the account, or magpie's own,
with how many client profiles were found and that none is the
account's. A client device another account's profile also has is named
as shared. No uid or device id is in the message. clientDevice now reads
through clientProfiles; its answers are unchanged.
Not done: explicit profile dirs or --user-data-dir discovery. Whether
TRAE CN keeps a separate, registered device in such a dir is unverified,
and the issue asks the reporter for that first.
Run at this tree (rebased onto ea9201d; nothing under packages/trae changed):
- mote-run, HOME=$(mktemp -d): packages/trae bun test 227 pass 0 fail;
whole repo bun test 3184 pass 0 fail at the rebased head; bun scripts/check.mjs ok.
`node scripts/check.mjs` fails with ERR_INVALID_ARG_TYPE here and on
main 4a46212 alike (it uses Bun's import.meta.dir; CI runs it with bun).
- win-run (xiaomi-gpu, Windows 11), fresh HOME: packages/trae 227 pass.
- Broken by hand: deviceNote reading no profiles turns the four new
#436 tests red (4 fail), green again restored.
Not tried: a real Trae CN account or client.
moxuanchen's change for #361 (a second Trae CN account can't check in).
- Every Trae CN client profile is read (Trae CN, TRAE SOLO CN, trae-cn):
the one signed in as the account gives its device. A profile signed in
as someone else, or one that doesn't parse, no longer hides the rest.
- A claim's code 0 is read back from the status. Not in after the claim
is `ineligible` for the day (no repeat claims); a failed read-back is
ineligible too.
- 9074's message says Trae did not take the check-in for this account's
device, and no longer sends people to Trae CN's app.
- Credit: the claim's credits, else its extra_credits, else the
read-back's credits; never summed (matches 0.2.21).
- Version 0.2.22, README updated.
Run at the reviewed head 4006fef51 (rebased on ba9801c), sandbox HOME:
- packages/trae: bun test, 213 pass, 0 fail. bun scripts/check.mjs: trae ok.
- Broken by hand, each red: first profile decides (2 red), no read-back
(2 red), failed read-back reported as failed (1 red), credits summed
(2 red), TRAE SOLO CN folder dropped (1 red). Restored after.
Not tried: a real second Trae CN account, and TRAE SOLO CN's real
storage.json (its folder and keys are inferred, as the README says).
A status that lags a claim that did land would read ineligible once
that day; the README names it.
zhujiu (magpie Discord #feedback, 10-25): "trae签到的积分为100而不是200 …
显示错误了". The card showed a claimed Trae CN check-in as 200 credits;
the account got 100.
Cause: auth.checkin's claimed outcome was the claim's credits +
extra_credits, falling back to the status's credits + extra_credits.
Trae CN's real claim answer names no credit at all ({"code":0,
"message":"success"}, plugins#194), so the fallback always ran, and a
real account's status carries both fields at 100 ({"checked_in": false,
"code": 0, "credits": 100, "did_checked_in": false, "enable": true,
"extra_credits": 100}, yetone/magpie#808): 100 + 100 = 200. magpie's own
Go check-in (internal/provider/trae_checkin.go, used only for plugins
before 0.2.17) fell back to the status's credits alone, and its real run
recorded credit 100 (plugins#194).
Now the credit is the claim's credits, else its extra_credits when it
names only that (#260's case), else the status's credits; the two are
never added. The done outcome already read credits alone. Trae Global
has no check-in, so this is CN only. What extra_credits means on Trae's
side is not known; nothing seen shows it granted on top.
Tests (native-checkin.test.mjs): the real status and claim answers give
credit 100; a claim naming both gives 100; a checked-in day with
extra_credits is done with 100. On origin/main's index.mjs the first two
fail (Expected credit 100, Received 200). HOME=<scratch> bun test in
packages/trae: 206 pass, 0 fail; bun scripts/check.mjs trae: ok.
Not tried with a real Trae CN account (none here); the shapes are the
real ones quoted in #808 and plugins#194. PR #333 touches the same
fallback line and needs a rebase.
A check-in claim answering extra_credits alone is credited (NaN before); an
empty reasoning_content no longer hides the event's reasoning; a native call's
name snapshot that grows takes the place of its first piece; a Global reply's
error names Trae Global.
Run at the reviewed head 2a0a835, merged with #257 and #273 on main 68170b3:
bun test in packages/trae 173 pass 0 fail; check.mjs trae ok. The new tests
fail on main's index.mjs. Not tried against a live Trae account.
#178's README called 9095 done and 9074 failed. The code answers both as
ineligible, the same as magpie's built-in check-in, so that 9074 isn't
asked again that day. The test asserting ineligible was named "is failed".
Docs and a test name only, so no version bump. bun test
packages/trae/native-checkin.test.mjs gives 9 pass, and check.mjs trae is ok.
Trae CN's daily check-in moves into the plugin as auth.checkin. It asks
/trae/api/v2/ug/checkin_credits/status and then /claim through ownRequest,
so it carries the same JWT renewal, IDE headers, {req_source: 1} body and
16-digit ugDevice (#194) as every other ug page. Trae Global answers
inactive. 9095 on the claim is ineligible, the same as magpie's built-in
traeRefused. 9074 on the claim is an answer for the day: ineligible, with a
hint to check in in the Trae CN app. The built-in calls that own-app, which
the plugin protocol doesn't have. trae 0.2.17.
Run at the reviewed head 4e9bb87 (on top of origin/main 63a3d2a..c397e96):
- bun test packages/trae: 160 pass, 0 fail. The global.test.mjs and
stream.test.mjs failures the author saw did not reproduce.
- bun scripts/check.mjs trae: ok.
- Broken by hand, one at a time, and each turned native-checkin.test.mjs red:
9074 mapped to failed; the ugDevice line in ownRequest removed; the
unreadable-claim guard removed.
- magpie's plugin host (yetone/magpie 85eef5d87 build, sandbox HOME, a copy
of the package pointed at a fake Trae on 127.0.0.1:18764), via
`magpie accounts checkin --json`. The results were claimed 100, 9074
ineligible with the app hint, 9095 ineligible, and checked_in done 100
with no claim sent. Status and claim both went out with
x-device-id 2866487253502651 and {"req_source":1}.