4e0cdabbbae17eaab9d62b2995f90033362b92b9
2
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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 |
||
|
|
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).
|