@liuyuexue2020 on X (0.2.43, Trae CN enterprise seat, console.enterprise.trae.cn,
model AI/deekseek-v4.1-flash): in Trae the model writes past 2000 tokens;
through magpie every reply stopped at exactly 2,000 output tokens (their
Usage rows: 26,037 / 2,000, 24,870 / 2,000, 23,097 / 2,000, streamed).
Cause: chatBody sent max_tokens only when the agent named one, held to the
__dev detail's max_tokens (`most`). An enterprise model has no __dev
detail, so it had no `most`, its listed output limit was 0, and an agent
naming no limit sent llm_utils_chat none. Trae's own client always sends
one: the ai-agent's ModelConfig carries the detail's max_tokens with every
model ("[ModelConfig] Received config_name=, model_name=, max_turn=,
prompt_max_tokens=, max_tokens=" in Trae CN 3.4.20's ai-agent strings;
CloudModelDetailInfo has max_tokens beside model_name and provider). The
2000 is most likely what Trae gives a request naming none; that wasn't
measured, having no seat.
Now:
- an enterprise model's `most` and listed output come from its own detail
(enterpriseDetail: the __dev one, else the first naming a model);
- every chat whose model has a known `most` sends it when the agent names
no limit, and holds a larger ask to it, as Max mode already did. A
preset asked through the function naming its __dev detail now sends
that detail's max_tokens too, the value Trae's client sends; a function
that doesn't name it still sends nothing.
- a detail with no max_tokens sends the agent's limit or none, as before.
Siblings: Trae CN and Trae international are one plugin (both sites go
through chatBody); SOLO's functions (solo_agent, solo_coder, ...) too. No
other plugin in the repo sets a fixed max_tokens/max_output_tokens cap
(grep for 1000/1024/2000/2048/4000/4096 near those keys). magpie's gateway
sends no fixed 2000 (its fill-in, askedOutput, is Anthropic-only).
Run (mote, HOME=$(mktemp -d), this tree on 62645ece):
packages/trae bun test: 287 pass, 0 fail (24 files);
bun scripts/check.mjs trae: ok;
root bun test: 9058 pass, 0 fail, 9078 tests across 636 files (514s);
bun scripts/check.mjs (all packages): ok.
Broken by hand: with 0.2.43's index.mjs, entmodels.test.mjs has 2 of 10
red: the enterprise test (max_tokens 0 listed / none sent, expected 8192)
and the preset test (undefined, expected 32000).
Not tried: a real enterprise seat (we have none), so the detail's
max_tokens in the fixture (8192) is invented and the 2000 default
is inferred from the reporter's numbers. If their detail carries no
max_tokens, a request naming none still goes without one.
32 lines
713 B
JSON
32 lines
713 B
JSON
{
|
|
"name": "@magpie-community/opencode-trae-auth",
|
|
"version": "0.2.44",
|
|
"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"
|
|
}
|
|
}
|