gateway, gui: a built-in is turned on in Plugins › Built-in, not a Settings › Plugins that isn't there

Errors and notices sent people to "Settings › Plugins" or called a
built-in "the … plugin", where no such page is and the thing is a
built-in (item 18, "Plugin" qualified where it's ambiguous). They now
name Plugins › Built-in and say built-in.

Own tests: builtins, websearch-places; Go: the gateway tests whose
strings changed (TestKeyLimitsOnAndOff, TestSearchOnAndOff,
TestToolsMCP*, TestHubMCPHeldToKeyLimit, TestVisionMCPHeldToKeyLimit),
internal/gui's plugins_own_* tests, davsync, gwbudget, gwmw, provider.

Run (mote, Chromium and WebKit, en zh zh-TW ja de):
- before the rebase, 23 GUI files: every one green except
  plugin-provider-options (my bug, fixed in this branch before the push)
  and settings-groups' "warm-ups and check-in in each service's provider
  editor", red the same way at fresh origin/main 98c487d09 (an extra
  "Spend extra usage" row; #6597, commented with the sha).
- rebased on origin/main 98c487d09: advanced-headings,
  plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
  settings-search, panel-profiles, builtins, chatgpt-usage-why,
  provider-concurrency, websearch-places, library-mcp-hub all green;
  go test ./internal/gui -run 'TestCoreScriptBudget|TestI18n|TestCSS' ok;
  ./internal/library, pii, plugin, provider and access ok; go vet ok.
  No budget raised.

Again at the pushed head, rebased on origin/main 39c5040d7 and 07d19510f
(mote, Chromium and WebKit, every language): advanced-headings,
plugin-provider-options, i18n-keys, routing-advanced, provider-prefs,
settings-search, panel-profiles, builtins, chatgpt-usage-why,
provider-concurrency, websearch-places, library-mcp-hub, codex-client,
codex-client-editor and nav-timeout all green; go test ./internal/gui
-run 'TestCoreScriptBudget|TestI18n|TestCSS' ok; ./internal/library, pii,
plugin, provider, access, ghtoken, davsync and gwmw ok, and the gateway
and agent tests whose strings changed; gofmt -l empty; go vet,
GOOS=linux go vet -tags nogui ./... and GOOS=windows go vet ./internal/...
clean. (GOOS=linux go vet ./... without nogui stops in Wails' cgo-only
webview_window_linux.go, the same on origin/main 39c5040d7.)

Not tried: the real app window, and Linux/Windows runs (cross-OS go vet
only).
This commit is contained in:
yetone
2026-11-18 14:32:44 +08:00
parent 87af7281e2
commit d90780c5d4
17 changed files with 26 additions and 26 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ import (
// addPlugins is backup.AddPlugins: a var so a test installs nothing.
var addPlugins = backup.AddPlugins
// removePlugin is provider.RemovePlugin, as Settings → Plugins removes one:
// removePlugin is provider.RemovePlugin, as the Plugins page removes one:
// a var so a test removes nothing.
var removePlugin = func(name string) error {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
+2 -2
View File
@@ -66,7 +66,7 @@ func TestKeyLimitsOnAndOff(t *testing.T) {
withoutLimits(t)
setLimit(t, keys[0].ID, &access.Limit{Period: "day", Tokens: 100000})
w := call(secrets[0])
if w.Code != http.StatusServiceUnavailable || !strings.Contains(w.Body.String(), "Key limits plugin") || w.Header().Get("X-Should-Retry") != "false" {
if w.Code != http.StatusServiceUnavailable || !strings.Contains(w.Body.String(), "Key limits built-in") || w.Header().Get("X-Should-Retry") != "false" {
t.Fatal("off: a limited key's request", w.Code, w.Body.String(), w.Header())
}
if calls.Load() != 2 {
@@ -75,7 +75,7 @@ func TestKeyLimitsOnAndOff(t *testing.T) {
if rec := lastUsage(t); !rec.Rejected || rec.CallerKeyID != keys[0].ID || rec.ErrType != "gateway_key_limit_off" || rec.Status != 503 {
t.Fatalf("off: refusal recorded as %+v", rec)
}
if err := mcp(); err == nil || !strings.Contains(err.Error(), "Key limits plugin") {
if err := mcp(); err == nil || !strings.Contains(err.Error(), "Key limits built-in") {
t.Errorf("off: the search MCP server said %v, not that the plugin is off", err)
}
if w := call(secrets[1]); w.Code != 200 {
+1 -1
View File
@@ -390,7 +390,7 @@ func TestHubMCPHeldToKeyLimit(t *testing.T) {
r := httptest.NewRequest("POST", HubMCPPath+"claude", nil).WithContext(access.WithIdentity(t.Context(), capped))
res, rpcErr := s.hubMCPCall(r, "claude", mcpMessage{ID: json.RawMessage("1"), Method: "tools/call", Params: json.RawMessage(`{"name":"fs__read","arguments":{}}`)})
b, _ := json.Marshal(res)
if rpcErr != nil || !strings.Contains(string(b), `"isError":true`) || !strings.Contains(string(b), "Key limits plugin") {
if rpcErr != nil || !strings.Contains(string(b), `"isError":true`) || !strings.Contains(string(b), "Key limits built-in") {
t.Errorf("a limited key with limits off: %s %v", b, rpcErr)
}
if len(f.ran()) != 0 {
+1 -1
View File
@@ -821,7 +821,7 @@ func (s *Server) webSearch(ctx context.Context, query string) (string, []Hit, er
var errNoSearcher = errors.New("no provider that can search the web, nor a search API, is set up in magpie")
// errSearchOff is a search asked of magpie while plugins/search is off.
var errSearchOff = errors.New("magpie's web search is off: turn the Web search plugin on in magpie's Settings › Plugins")
var errSearchOff = errors.New("magpie's web search is off: turn Web search on in magpie's Plugins › Built-in")
// searchServed is whether plugins/search serves magpie's web search here
// (the gateway's tool point, gwtool): off, magpie neither offers its
+1 -1
View File
@@ -101,7 +101,7 @@ func TestSearchOnAndOff(t *testing.T) {
if !strings.Contains(ask(true), "web_search_20250305") {
t.Error("off: a vendor that searches by itself lost its own web_search")
}
if _, err := mcp(); err == nil || !strings.Contains(err.Error(), "Web search plugin") {
if _, err := mcp(); err == nil || !strings.Contains(err.Error(), "Plugins › Built-in") {
t.Errorf("off: MCP search said %v, not that the plugin is off", err)
}
for _, ctx := range []context.Context{context.Background(), searchingOn(context.Background(), plan)} {
+3 -3
View File
@@ -45,7 +45,7 @@ var (
)
// errToolsOff is what a call is answered while plugins/tools is off.
const errToolsOff = "magpie's Plugin tools plugin is off, so no plugin's tool runs; turn it on in magpie's Settings → Plugins"
const errToolsOff = "magpie's Plugin tools built-in is off, so no plugin's tool runs; turn it on in magpie's Plugins › Built-in"
func (s *Server) toolsMCP(w http.ResponseWriter, r *http.Request) {
serveMCP(w, r, "magpie's plugin tools", "magpie-tools", toolsMCPBody, s.toolsMCPCall)
@@ -223,9 +223,9 @@ func RunPluginToolOf(ctx context.Context, name, tool string, args json.RawMessag
func (s *Server) toolsMCPServe(r *http.Request, m mcpMessage, one string, servedTools func(context.Context) ([]mcpTool, error)) (any, map[string]any) {
switch m.Method {
case "initialize":
say := "The tools the plugins added to magpie give, each named <plugin>_<tool>. Add or switch plugins in magpie's Settings → Plugins."
say := "The tools the plugins added to magpie give, each named <plugin>_<tool>. Add or switch plugins on magpie's Plugins page."
if one != "" {
say = "The tools magpie's plugin " + one + " gives. Add or switch plugins in magpie's Settings → Plugins."
say = "The tools magpie's plugin " + one + " gives. Add or switch plugins on magpie's Plugins page."
}
return map[string]any{
"protocolVersion": mcpVersion(m),
+1 -1
View File
@@ -78,7 +78,7 @@ func TestToolsMCPOnePlugin(t *testing.T) {
if ts, _ := PluginToolsOf(ctx, "@magpie-community/tools-search1api"); len(ts) != 0 {
t.Errorf("off, PluginToolsOf = %v", ts)
}
if _, err := RunPluginToolOf(ctx, "@magpie-community/tools-search1api", "search", nil, ""); err == nil || !strings.Contains(err.Error(), "Plugin tools plugin is off") {
if _, err := RunPluginToolOf(ctx, "@magpie-community/tools-search1api", "search", nil, ""); err == nil || !strings.Contains(err.Error(), "Plugin tools built-in is off") {
t.Errorf("off, RunPluginToolOf: %v", err)
}
}
+2 -2
View File
@@ -113,7 +113,7 @@ func TestToolsMCPOff(t *testing.T) {
t.Errorf("off, listed %+v", m)
}
m := readMCP(t, toolsPost(h, toolsCall("x_y", `{}`)))
if !m.Result.IsError || len(m.Result.Content) == 0 || !strings.Contains(m.Result.Content[0].Text, "Plugin tools plugin is off") {
if !m.Result.IsError || len(m.Result.Content) == 0 || !strings.Contains(m.Result.Content[0].Text, "Plugin tools built-in is off") {
t.Errorf("off, a call said %+v", m)
}
if len(*ran) != 0 || asked != 0 {
@@ -145,7 +145,7 @@ func TestToolsMCPHeldToKeyLimit(t *testing.T) {
r := httptest.NewRequest("POST", ToolsMCPPath, nil).WithContext(access.WithIdentity(t.Context(), capped))
res, rpcErr := s.toolsMCPCall(r, mcpMessage{ID: json.RawMessage("1"), Method: "tools/call", Params: json.RawMessage(`{"name":"x_y","arguments":{}}`)})
b, _ := json.Marshal(res)
if rpcErr != nil || !strings.Contains(string(b), `"isError":true`) || !strings.Contains(string(b), "Key limits plugin") {
if rpcErr != nil || !strings.Contains(string(b), `"isError":true`) || !strings.Contains(string(b), "Key limits built-in") {
t.Errorf("a limited key with limits off: %s %v", b, rpcErr)
}
if len(*ran) != 0 {
+1 -1
View File
@@ -209,7 +209,7 @@ func TestVisionMCPHeldToKeyLimit(t *testing.T) {
setLimit(t, keys[0].ID, &access.Limit{Period: "day", Tokens: 100000})
looked := len(u.sent("eye"))
m = readMCP(t, visionPost(h, "127.0.0.1:5000", analyzeCall("data:image/png;base64,aGVsbG8=", ""), "Authorization", "Bearer "+secrets[0]))
if !m.Result.IsError || !strings.Contains(m.Result.Content[0].Text, "Key limits plugin") {
if !m.Result.IsError || !strings.Contains(m.Result.Content[0].Text, "Key limits built-in") {
t.Fatalf("off: %+v", m)
}
if n := len(u.sent("eye")); n != looked {
+1 -1
View File
@@ -4585,7 +4585,7 @@ input.words.remote-key { width: 160px; }
:root[data-theme="dark"] .warm-at input.at { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .warm-at input.at { color-scheme: dark; } }
@media (max-width: 520px) { .proxy-segs { flex-wrap: wrap; justify-content: flex-end; } }
/* Settings → Plugins: what a plugin signs in to, or why it didn't load, said whole */
/* Plugins page: what a plugin signs in to, or why it didn't load, said whole */
.row.pref.plugin-row .sub, .row.pref.plugin-add .sub { white-space: normal; }
.row.pref.plugin-row.off .name { color: var(--muted); }
.row.pref.plugin-add .val { flex-wrap: wrap; justify-content: flex-end; }
+5 -5
View File
@@ -45,7 +45,7 @@ const I18N = {
"No provider lists a speech-to-text model": "没有供应商列出语音转文字模型",
"No provider lists a text-to-speech model": "没有供应商列出文字转语音模型",
"no provider that can search the web, nor a search API, is set up in magpie": "magpie 里没有设置能联网搜索的供应商,也没有搜索 API",
"magpie's web search is off: turn the Web search plugin on in magpie's Settings › Plugins": "magpie 的联网搜索已关闭:在 magpie 的设置 › 插件里打开“联网搜索”插件",
"magpie's web search is off: turn Web search on in magpie's Plugins › Built-in": "magpie 的联网搜索已关闭:在 magpie 的 插件 › 内置 里打开“联网搜索”",
"Another magpie serves the gateway: check there": "另一个 magpie 在提供网关:请在那边检测",
"paused": "已暂停",
"Resume gateway": "恢复网关",
@@ -3352,7 +3352,7 @@ const I18N = {
"Status line on another computer": "其他电脑上的状态栏",
"statusLine's command in Claude Code's settings.json there; a read-only gateway key is enough": "填入那台电脑 Claude Code 的 settings.json 里 statusLine 的 command;只读网关密钥即可",
// sync and backup
// OpenCode's provider plugins: Settings → Plugins, the add sheet's "From plugins"
// OpenCode's provider plugins: the Plugins page, the add sheet's "From plugins"
"Plugins": "插件",
"Work": "使用",
"Insights": "观测",
@@ -5525,7 +5525,7 @@ const I18N = {
"No provider lists a speech-to-text model": "沒有供應商列出語音轉文字模型",
"No provider lists a text-to-speech model": "沒有供應商列出文字轉語音模型",
"no provider that can search the web, nor a search API, is set up in magpie": "magpie 裡沒有設定能聯網搜尋的供應商,也沒有搜尋 API",
"magpie's web search is off: turn the Web search plugin on in magpie's Settings › Plugins": "magpie 的聯網搜尋已關閉:在 magpie 的設定 › 外掛裡開啟「聯網搜尋」外掛",
"magpie's web search is off: turn Web search on in magpie's Plugins › Built-in": "magpie 的聯網搜尋已關閉:在 magpie 的 外掛 › 內建 裡開啟「聯網搜尋」",
"Another magpie serves the gateway: check there": "另一個 magpie 在提供閘道:請在那邊檢測",
"paused": "已暫停",
"Resume gateway": "恢復閘道",
@@ -10989,7 +10989,7 @@ const I18N = {
"No provider lists a speech-to-text model": "音声認識モデルを載せているプロバイダがありません",
"No provider lists a text-to-speech model": "音声合成モデルを載せているプロバイダがありません",
"no provider that can search the web, nor a search API, is set up in magpie": "ウェブ検索できるプロバイダも検索 API も magpie に設定されていません",
"magpie's web search is off: turn the Web search plugin on in magpie's Settings › Plugins": "magpie のウェブ検索はオフです:magpie の設定 › プラグインでウェブ検索プラグインをオンにしてください",
"magpie's web search is off: turn Web search on in magpie's Plugins › Built-in": "magpie のウェブ検索はオフです:magpie の プラグイン › 内蔵 でウェブ検索をオンにしてください",
"Another magpie serves the gateway: check there": "別の magpie がゲートウェイを提供しています:そちらでチェックしてください",
"paused": "一時停止中",
"Resume gateway": "ゲートウェイを再開",
@@ -16455,7 +16455,7 @@ const I18N = {
"No provider lists a speech-to-text model": "Kein Anbieter führt ein Spracherkennungsmodell",
"No provider lists a text-to-speech model": "Kein Anbieter führt ein Sprachausgabemodell",
"no provider that can search the web, nor a search API, is set up in magpie": "In magpie ist weder ein Anbieter, der im Web sucht, noch eine Such-API eingerichtet",
"magpie's web search is off: turn the Web search plugin on in magpie's Settings › Plugins": "magpies Websuche ist aus: Schalte das Websuche-Erweiterung in magpies Einstellungen › Erweiterungen ein",
"magpie's web search is off: turn Web search on in magpie's Plugins › Built-in": "magpies Websuche ist aus: Schalte die Websuche in magpies Erweiterungen › Eingebaut ein",
"Another magpie serves the gateway: check there": "Ein anderes magpie stellt das Gateway bereit: Teste dort",
"paused": "pausiert",
"Resume gateway": "Zugangspunkt fortsetzen",
+2 -2
View File
@@ -24,7 +24,7 @@ import (
)
// OpenCode's provider plugins (internal/plugin): the providers they sign
// in to are subscriptions in the add sheet, and Settings → Plugins adds,
// in to are subscriptions in the add sheet, and the Plugins page adds,
// updates and removes them.
// pluginSubJSON is a plugin's provider as the add sheet lists it.
@@ -99,7 +99,7 @@ func pluginSubs() []pluginSubJSON {
return out
}
// pluginEntryJSON is a plugin as Settings → Plugins lists it.
// pluginEntryJSON is a plugin as the Plugins page lists it.
type pluginEntryJSON struct {
plugin.Entry
Error string `json:"error,omitempty"` // why it didn't load
+1 -1
View File
@@ -12,7 +12,7 @@ import (
// #1775 (peterroe): a plugin of several providers gives each its own
// picture in the auth hook and itself one in package.json's magpie.icon.
// Settings → Plugins is told the plugin's own, checked and kept as a
// the Plugins page is told the plugin's own, checked and kept as a
// listed plugin's is, apart from its providers'; one that gives none, or
// a picture magpie doesn't take (plain http), is told none.
func TestPluginsStateGivesThePluginsOwnIcon(t *testing.T) {
+1 -1
View File
@@ -13,7 +13,7 @@ import (
// #4558 (MYCF711): a plugin installed from git whose package.json says
// magpie.name ("华为云 HUAWEI") read as its dependency key
// (magpie-officeace) in Settings → Plugins. Bun takes no non-ASCII key, so
// (magpie-officeace) in the Plugins page. Bun takes no non-ASCII key, so
// the package's own name is the only readable one it has. The row is told
// it (ownName), as is the sidebar's title for a page that names none; a
// package that gives none is told none, and the community's list still
+1 -1
View File
@@ -103,7 +103,7 @@ func ForgetRefreshForTest() { lastAsk.Store(0) }
// ErrUnlimited is the error a key's request gets when the key is held to
// a limit and nothing can hold it.
var ErrUnlimited = errors.New("this gateway key is held to a limit, but magpie's Key limits plugin isn't serving it, so nothing was sent; turn the plugin on in magpie's Settings → Plugins")
var ErrUnlimited = errors.New("this gateway key is held to a limit, but magpie's Key limits built-in isn't serving it, so nothing was sent; turn it on in magpie's Plugins › Built-in")
// Limiting is the limiter for who's request: nil, nil when who has no
// limit; ErrUnlimited when it has one and none serves. With none, one
+1 -1
View File
@@ -268,7 +268,7 @@ func ForgetRefreshForTest() {
// ErrUnmasked is the error a request gets when masking is wanted and
// nothing can mask it.
var ErrUnmasked = fmt.Errorf("masking is on in magpie's Settings → Privacy, but the redact plugin isn't serving it, so nothing was sent; turn the plugin on in Settings → Plugins")
var ErrUnmasked = fmt.Errorf("masking is on in magpie's Settings › Privacy, but the Masking built-in isn't serving it, so nothing was sent; turn it on in Plugins › Built-in")
// Served is the masker that serves now. With none, one refresh is asked
// (at most once a second, never from inside one) and it is looked for
+1 -1
View File
@@ -196,7 +196,7 @@ func withoutSecretOptions(opts map[string]any) map[string]any {
}
// AddPlugins installs the plugins another computer has (Carried) that
// aren't here, the way Settings → Plugins adds one, and hands each a
// aren't here, the way the Plugins page adds one, and hands each a
// deprecated built-in it serves (HandOver). It never takes a plugin away
// or changes one already here; a removal is davsync's, which tracks the
// plugins both sides had at the last sync. It returns the specs added and why the others couldn't be.