Commit Graph
5 Commits
Author SHA1 Message Date
yetone 9621168c46 provider: a plugin's thinking model with no variants borrows its maker's reasoning levels
laomao04_65777 on Discord: in Codex, with SenseTime Raccoon (商汤小浣熊)
picked, the reasoning effort couldn't be switched.

Cause: Raccoon's plugin lists its models as thinking with no variants.
Its sn-* ids (sn-glm-5-3, sn-kimi-k3, sn-glm-5-3-flash,
sn-deepseek-v4-1-flash, sn-deepseek-v4-pro) are ones models.dev knows
under the maker's spelling (catalog.Knows). So levelsUnknown counted
them as known and offered nothing, and pluginCatalog borrowed the
maker's levels only for moved built-ins and Cline. Codex's catalog got
supported_reasoning_levels [] and hid the picker. A custom provider's
same id already borrows them (effortsOf), and an id models.dev doesn't
know already got low/medium/high (ddb1701fe).

The class: every plugin model that says it thinks and gives no
variants now borrows its maker's levels (borrowedEfforts). OpenCode
also reads no variants as nothing said and makes its own from the SDK
(packages/core/src/variant.ts, low/medium/high for openai-compatible).
A model with variants keeps them. A model that doesn't say it thinks
gets nothing borrowed.

What the vendor takes: xiaohuanxiong.com has no public API docs. The
official 1.1.3 desktop app's code only flips enable_deep_thinking on
its web API. The gateway already sends Codex's effort (medium) to
Raccoon today, because fitEffort passes it through when there are no
levels, and no rejection has been reported. The levels borrowed are
the maker's (kimi-k3, glm-5.3, deepseek-v4 on models.dev).
magpie-community/plugins#598 asks the plugin for real per-model
reasoning and variants.

Run (mote, at 88183d15d on origin/main 1fac66c06; then rebased onto
57246b381, whose 3 commits since touch none of provider, plugin, codexcat
or catalog):
- go test -tags nogui ./internal/provider ./internal/codexcat
  ./internal/catalog: all ok (provider 154s)
- go test -run 'Effort|Reason|Level|PluginCatalog|Variant'
  ./internal/gateway ./internal/agent: both ok
- gofmt -l clean. GOOS=linux and GOOS=windows go vet ./internal/provider
  pass.
- A repro against a copy of the live models.dev cache, with the
  Raccoon plugin's 11 models: before, the five sn-* ids got []. After,
  sn-kimi-k3, sn-glm-5-3, sn-glm-5-3-flash and sn-deepseek-v4-pro get
  [low high max], and sn-deepseek-v4-1-flash gets
  [none low high max]. The raccoon-*/sensenova ids are unchanged
  ([low medium high]).

Broken by hand: with plugins.go reverted,
TestPluginThinkingModelBorrowsEfforts is red ("raccoon/sn-kimi-k3
offered [] in Codex", and so are the provider's Efforts).
TestMovedKeepsEfforts now also checks a plugin's own variants and the
non-thinking case.

Not tried: a real Raccoon account (none here), so no request with a
borrowed level went to xiaohuanxiong.com. Not tried in the real Codex
app either. Not a full ./... suite: mote was at load 270 with another
session's gateway suite running.
2026-11-01 18:28:31 +08:00
yetone 07a445f42b provider: Devin's built-in is retired; its plugin serves it
"devin" joins retiredBuiltins, as Zed (c0605abc2) and Grok (60ecd598c)
did. @magpie-community/opencode-devin-auth serves it, moved or not.

Removed:
- Sign-in: the PKCE localhost listen and callback branch in signin.go,
  devinExchange/devinExchangeURL. The exchange is Codex's alone again.
- Accounts: devinAccount and devinProvider in the account list, and the
  Logins, switch, on and forget cases (devinSide, devinLoginList,
  switchDevinLogin, setDevinLoginOn, forgetDevinLogin, removeDevinHome,
  addDevinLogin, devinAlsoOn). "devin" keeps its place in Logins("") with
  a nil list.
- Usage: devin_usage.go whole (perLogin fetch, usageLogins, loginQuota).
  devinUsageVersion moved to devin_images.go, which still uses it.
- asksOwnBackend's "devin".
- Gateway: attempt()'s serveDevin dispatch and the Devin translator
  (serveDevin, askDevin, buildDevin, decodeDevin, the Gemini schema and
  tool-description rewriting, the call-id helpers). gateway/devin.go is
  now connect_pb.go and keeps only the protobuf and Connect framing that
  cursor.go uses.
- Tests of the built-in alone: gateway devin_test, devin_gemini_schema,
  devin_sampling and devin_tool_ids; provider devin_usage_test,
  devin_cli_signed_out_test, TestDevinSignIn, TestDevinSeveralAccounts,
  TestSignInInstallsMissingCLI, TestDevinSignInUnseen, the Devin case of
  the required-tools test, and TestDevinSplitParallelCallsKeepTheirResults.

Kept, because the plugin, the devin agent or the move uses them:
- The mover, devinLogins, devinIdentity/devinStatus, DevinAuthAt,
  devinCredentialsAt, newDevinHome, devinCommand/devinProxy.
- DevinFamilies, DevinVariant and models.go's p.ID == "devin" shaping
  (the plugin's provider id is "devin" too). internal/agent/devin.go
  reads the families.
- The installer's "devin" case: the plugin's sign-in installs the CLI.
- The PLUGIN-SERVED notices in devin.go, devin_accounts.go and
  devin_images.go, reworded as retired.

Also fixed:
- cliIdentities no longer lists devinStatus. No look at the accounts
  asks it now, so it stayed unsettled, and FetchNewBehind told every page
  that lists were on their way (TestFetchingNewOnceStarted went red).
- 60ecd598c (Grok) left TestFetchingNewForgottenWhileListed red: its
  hook was GrokExecutable in the account listing. It and
  TestFetchNewListsAgainForAnAnswerWhileListing now hook kiroCLIDB,
  which is read after Cursor's account. Retiring Kiro will need another
  hook.

Tests whose meaning changed:
- TestSignInInstallFails and TestSignInCanceledWhileInstalling go
  through StartPluginSignIn("devin"), the plugin's install of the CLI.
- TestDevinCLIGoesThroughItsProxy seeds both accounts in logins.json
  instead of signing one in. The sign-in's proxy is covered by
  TestPluginSignInGoesThroughItsProxy.
- TestLeftAloneRunsNoCLI no longer expects `devin auth status` when the
  subscription is switched on.
- TestFetchingNewOnceStarted's unanswered CLI is Cursor's.
- devinRawID moved to anthropic_call_ids_test.go. A Devin call id is
  checked as safeCallID("dv_", ...).

Run:
- gofmt -l internal: clean.
- go vet -tags nogui ./... on darwin, GOOS=linux and GOOS=windows: clean.
- staticcheck U1000 on provider and gateway: no Devin leftovers.
- go test -tags nogui -count=1 -run '^(every test in provider, cli and
  gateway that names Devin|TestFetchNew.*|TestFetchingNew.*|
  TestLeftAlone.*|.*Identit.*)$' ./internal/provider ./internal/cli
  ./internal/gateway: ok.
- -run 'Migrat|Move|Moved|Retir|SignIn|AsksOwnBackend|SideLogin|Logins|
  Unmoved|Install|Proxy|Account' ./internal/provider: ok.
- -run 'Devin|Required|Split|CallID|Cursor|Connect|Parity|ToolImage|
  Format|BillingLine' ./internal/gateway: ok.
- -run 'Devin|Plugin|Retired|Moved' ./internal/gui ./internal/agent: ok.
- Not run: the whole packages, the full suite, the GUI node suite (the
  machine is loaded).
2026-10-17 23:11:01 +08:00
yetone 322842c1c0 provider: ClinePass signed in through the Cline plugin shows the reasoning levels its API key does (zRain, Discord) — the plugin gives no levels of its own, and only a moved built-in borrowed its models' makers', so every plugin-served Cline model had none while the ClinePass built-in borrowed them. Cline's plugin now borrows as the built-in does. TestClinePluginBorrowsEfforts fails without the change. go vet, go build -tags nogui (darwin, GOOS=linux, GOOS=windows), go test -tags nogui ./... under a temp HOME pass. 2026-10-05 15:00:35 +08:00
yetone b9895c2ded tests: the gateway's and Devin's tests run on Windows in a home of their own — on Windows os.UserHomeDir reads USERPROFILE, not HOME, so a test that set HOME to a temp dir still found the one USERPROFILE every gateway test shares (and the box's real agents); Devin's CLI keeps its sign-in under APPDATA. Each such test now sets USERPROFILE with HOME (setHome), TestDevinOwnMovesWithPlan sets APPDATA, and the tests whose Claude Code is a shell script skip on Windows, where it can't run and the box's real claude ran instead. Tests only. The gateway suite and TestDevinOwnMovesWithPlan pass on Windows; go test -tags nogui ./... passes on macOS. 2026-10-01 20:26:53 +08:00
yetone 813fdcb2e5 migrate: a moved built-in keeps its models' reasoning levels, its own account's plan and one own row, and the move checks each account through its proxy (要保证插件订阅 provider 跟内置的订阅 provider所有逻辑都要一模一样) — Command Code's, Grok's and WorkBuddy's models their vendor gives no levels for lost the ones the built-in borrowed from their maker; moved, they borrow them again. Devin's own account moved without the plan the Devin CLI says, which the built-in showed. The agent signing in to another account while moved wrote a new own row for the built-in, which came back beside the one set aside as a second own account; nothing is written while moved, and going back keeps the one. And the move's check of an account asked the vendor directly, not through the proxy its requests take. Found walking Command Code, Grok, Devin, ZCode and WorkBuddy through sandbox moves. TestMovedKeepsEfforts, TestMovedOwnRowNotWritten, TestDevinOwnMovesWithPlan and TestPluginProxy fail without the change. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. 2026-10-01 07:04:40 +08:00