Files
plugins/packages
yetone 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.
2026-11-02 18:57:34 +08:00
..
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00
middleware: param-override, model-map, system-prompt, word-guard and think-tags — gateway middleware that magpie runs on every agent's requests and replies, mostly New API's channel settings with the same JSON (the owner) — magpie can now run a plugin as gateway middleware (onRequest, onEvent, onResponse, in-process on moejs), and these are the first ones: param-override is New API's param_override (both forms, operations with gjson paths and conditions, return_error); model-map is model_mapping (chains, /regex/ keys with $1) and puts the asked-for name back into replies; system-prompt adds a prompt in each API's own place, keeping an agent's own unless override (New API's semantics), by agent or model; word-guard is the sensitive-word filter (reject or mask the user's text, optionally replies); think-tags strips a leading <think>…</think> from replies across stream chunks, or puts Chat reasoning_content into the text (thinking_to_content). Each is one file with no imports, named @magpie-community/middleware-<name>, with magpie.options as the example the app's editor starts from; registry.json lists them with "kind": "middleware" and no providers; check.mjs skips middleware-only packages. scripts/middleware.mjs calls the hooks as the gateway does (events split, [DONE] passed by) and runs each package's cases.json. Tested with a real DeepSeek account and real Claude Code through magpie's gateway: a mapped model named back in message_start, max_tokens capped, a system prompt appended for claude only, a word turned away as a 400 in Anthropic's shape, return_error as a 403 in Chat's, <think> stripped from Chat and Responses streams and an Anthropic whole reply, reasoning_content moved into the text. bun test (61 for these five) and bun scripts/check.mjs pass; packages/devin's two image tests fail on this machine only, as on main. Their first npm version has to be published by hand (trusted publishing can't create a package); until then magpie shows them as Coming soon.
2026-10-05 20:49:42 +08:00