Files
plugins/packages/cline/package.json
T
yetone 61d058f6cf cline 0.1.11: ClinePass's DeepSeek models are pinned to DeepSeek's own API by default, with only + has, and go once more unpinned if the pin can't be served (hy125245 on X)
hy125245 (X, 10-23) pinned Cline Pass to DeepSeek by hand with magpie's
extra body, `"!providerOptions": {"gateway": {"only": ["deepseek"],
"has": ["vision", "implicit-caching"]}}` on a plain API provider for
https://api.cline.bot/api/v1, model cline-pass/deepseek-v4.1-flash-1017.
Their finding: on ClinePass the server's virtual model config wins over
`only` alone (a fake upstream was served too); with `has` beside it the
request went to DeepSeek (finalProvider "deepseek", magpie's Requests
list "vmc/deepseek-v4p1-flash … 上游: de…", ~200-246 tok/s, 3 of 3) and
a fake upstream was refused with "no matching upstream". The bill showed
creditsUsed 0.

What changed
- A request for a cline-pass/deepseek-… model now carries
  providerOptions.gateway {only: ["deepseek"], has: [...]} by default,
  written in before the body's last } so the cached prefix is the
  client's byte for byte.
- `has` is "implicit-caching", plus "vision" only for a model that takes
  images: Cline's catalog (/ai/cline/models input_modalities, read by
  the models hook; the bundled list says so for deepseek-v4.1-flash and
  -1017 until it answers) or a request carrying an image part. The
  catalog lists deepseek-v4-pro as text-only, and asking vision of it
  would rule out every upstream.
- A request that already has provider or providerOptions (the client's,
  or the user's extra body in magpie) goes as sent, as before: magpie's
  default never overrides a value the user set.
- The default pin never fails a request that would have worked: a
  pinned request answered with no matching upstream (or "no available
  provider/endpoint") or any 5xx goes once more exactly as sent, same
  account and headers. Once only. A 400 of another kind, 401, 402, 403
  and 429 are the request's or the account's, answered as they are.
- pinUpstream: false (or "false") turns it off. pinUpstream on keeps its
  meaning ("only from the makers' own APIs"): ClinePass DeepSeek models
  get the only + has pin with no unpinned retry; other DeepSeek and GLM
  models are pinned as in 0.1.10.
- Non-DeepSeek ClinePass models, cline-free/deepseek-…, usage-billed
  deepseek/… (without pinUpstream) and every other model go as sent.

Decision (owner delegated product calls): default on for ClinePass's
DeepSeek models. The reporter measured DeepSeek's own API faster than
the private landing, credits unchanged (0), and DeepSeek's API caches by
itself; the retry removes the one downside (a pin that can't be served).
Not made per model: nothing measured says another default is right for
some users.

Run (at this commit, rebased on origin/main)
- bun test packages/cline: 93 pass (11 new).
- HOME=$(mktemp -d) bun test (whole repo, as pr.yml): 0 fail.
- bun scripts/check.mjs: all packages ok.

Broken by hand, each red:
- no default pin: 8 fail (pin, catalog vision, three fallback cases,
  retry-once, pinUpstream off/on, glm-5.3-flash table test).
- the user's providerOptions overridden: 3 fail, incl. the reporter's
  extra body kept word for word.
- no fallback: 4 fail.
- every cline-pass/ model pinned: 6 fail, incl. "other models go as sent".
- vision asked always: 2 fail.

Not tried
- No real Cline account: magpie has no Cline sign-in (plugin-auth.json
  has none, providers.json none; ~/.cline holds only other vendors'
  keys), and api.cline.bot answers 401 before routing, so none of
  finalProvider, speed, creditsUsed, caching, the text-only
  deepseek-v4-pro under has: ["implicit-caching"], or the exact wording
  of the no-upstream refusal was measured here. Built from the
  reporter's description; the fallback covers a wrong guess about
  what the gateway refuses.
- Other Pass models (GLM, Kimi, Qwen, MiMo, MiniMax) may have private
  vs official upstreams too; unmeasured, left unpinned.
- magpie's own ClinePass tick still writes `only` alone before the
  plugin sees the body; fixed in magpie separately.
2026-10-23 22:14:18 +08:00

13 lines
550 B
JSON

{
"name": "@magpie-community/opencode-cline-auth",
"version": "0.1.11",
"description": "Cline (cline.bot) on your own account — usage billing, ClinePass and the free models — in OpenCode and magpie",
"type": "module",
"main": "./index.mjs",
"exports": "./index.mjs",
"files": ["index.mjs", "README.md"],
"keywords": ["opencode", "opencode-plugin", "magpie", "cline", "clinepass"],
"license": "MIT",
"repository": { "type": "git", "url": "git+https://github.com/magpie-community/plugins.git", "directory": "packages/cline" }
}