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.
32 lines
713 B
JSON
32 lines
713 B
JSON
{
|
|
"name": "@magpie-community/opencode-trae-auth",
|
|
"version": "0.2.29",
|
|
"description": "OpenCode provider plugins for Trae: Trae CN (trae.cn) and Trae Global (trae.ai), free tier included, with Trae's own browser sign-in",
|
|
"type": "module",
|
|
"main": "./opencode.mjs",
|
|
"exports": {
|
|
".": "./opencode2.mjs"
|
|
},
|
|
"files": [
|
|
"index.mjs",
|
|
"opencode.mjs",
|
|
"opencode2.mjs",
|
|
"README.md"
|
|
],
|
|
"keywords": [
|
|
"opencode",
|
|
"opencode-plugin",
|
|
"magpie",
|
|
"trae",
|
|
"trae-cn",
|
|
"trae-global",
|
|
"bytedance"
|
|
],
|
|
"license": "MIT",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/magpie-community/plugins.git",
|
|
"directory": "packages/trae"
|
|
}
|
|
}
|