From d90780c5d405fe05c8cba09aa2918682a182d945 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 18 Nov 2026 12:48:50 +0800 Subject: [PATCH] =?UTF-8?q?gateway,=20gui:=20a=20built-in=20is=20turned=20?= =?UTF-8?q?on=20in=20Plugins=20=E2=80=BA=20Built-in,=20not=20a=20Settings?= =?UTF-8?q?=20=E2=80=BA=20Plugins=20that=20isn't=20there?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- internal/davsync/davsync.go | 2 +- internal/gateway/budget_plugin_test.go | 4 ++-- internal/gateway/hub_mcp_test.go | 2 +- internal/gateway/search.go | 2 +- internal/gateway/search_plugin_test.go | 2 +- internal/gateway/tools_mcp.go | 6 +++--- internal/gateway/tools_mcp_one_test.go | 2 +- internal/gateway/tools_mcp_test.go | 4 ++-- internal/gateway/vision_mcp_test.go | 2 +- internal/gui/assets/app.css | 2 +- internal/gui/assets/i18n.js | 10 +++++----- internal/gui/plugins.go | 4 ++-- internal/gui/plugins_own_icon_test.go | 2 +- internal/gui/plugins_own_name_test.go | 2 +- internal/gwbudget/gwbudget.go | 2 +- internal/gwmw/gwmw.go | 2 +- internal/provider/backup.go | 2 +- 17 files changed, 26 insertions(+), 26 deletions(-) diff --git a/internal/davsync/davsync.go b/internal/davsync/davsync.go index eb712712c..5f4e3d5c9 100644 --- a/internal/davsync/davsync.go +++ b/internal/davsync/davsync.go @@ -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) diff --git a/internal/gateway/budget_plugin_test.go b/internal/gateway/budget_plugin_test.go index afa12f003..d56ec5e73 100644 --- a/internal/gateway/budget_plugin_test.go +++ b/internal/gateway/budget_plugin_test.go @@ -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 { diff --git a/internal/gateway/hub_mcp_test.go b/internal/gateway/hub_mcp_test.go index 8c7b61210..5dc2a305e 100644 --- a/internal/gateway/hub_mcp_test.go +++ b/internal/gateway/hub_mcp_test.go @@ -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 { diff --git a/internal/gateway/search.go b/internal/gateway/search.go index e9b5051ac..e8ef28f95 100644 --- a/internal/gateway/search.go +++ b/internal/gateway/search.go @@ -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 diff --git a/internal/gateway/search_plugin_test.go b/internal/gateway/search_plugin_test.go index 70572c094..45f55a899 100644 --- a/internal/gateway/search_plugin_test.go +++ b/internal/gateway/search_plugin_test.go @@ -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)} { diff --git a/internal/gateway/tools_mcp.go b/internal/gateway/tools_mcp.go index 2ddff2981..046f43282 100644 --- a/internal/gateway/tools_mcp.go +++ b/internal/gateway/tools_mcp.go @@ -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 _. Add or switch plugins in magpie's Settings → Plugins." + say := "The tools the plugins added to magpie give, each named _. 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), diff --git a/internal/gateway/tools_mcp_one_test.go b/internal/gateway/tools_mcp_one_test.go index 42bfa56fa..2d55a8696 100644 --- a/internal/gateway/tools_mcp_one_test.go +++ b/internal/gateway/tools_mcp_one_test.go @@ -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) } } diff --git a/internal/gateway/tools_mcp_test.go b/internal/gateway/tools_mcp_test.go index d2a7e0b50..8b1845dbb 100644 --- a/internal/gateway/tools_mcp_test.go +++ b/internal/gateway/tools_mcp_test.go @@ -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 { diff --git a/internal/gateway/vision_mcp_test.go b/internal/gateway/vision_mcp_test.go index ae3e1bc46..09c124397 100644 --- a/internal/gateway/vision_mcp_test.go +++ b/internal/gateway/vision_mcp_test.go @@ -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 { diff --git a/internal/gui/assets/app.css b/internal/gui/assets/app.css index 93d013924..a59ba8694 100644 --- a/internal/gui/assets/app.css +++ b/internal/gui/assets/app.css @@ -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; } diff --git a/internal/gui/assets/i18n.js b/internal/gui/assets/i18n.js index 572aafaca..1b63cb949 100644 --- a/internal/gui/assets/i18n.js +++ b/internal/gui/assets/i18n.js @@ -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", diff --git a/internal/gui/plugins.go b/internal/gui/plugins.go index 2f145b16e..2a847e414 100644 --- a/internal/gui/plugins.go +++ b/internal/gui/plugins.go @@ -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 diff --git a/internal/gui/plugins_own_icon_test.go b/internal/gui/plugins_own_icon_test.go index 35ad4f7e4..0d00f8311 100644 --- a/internal/gui/plugins_own_icon_test.go +++ b/internal/gui/plugins_own_icon_test.go @@ -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) { diff --git a/internal/gui/plugins_own_name_test.go b/internal/gui/plugins_own_name_test.go index 230a3e734..796adad6d 100644 --- a/internal/gui/plugins_own_name_test.go +++ b/internal/gui/plugins_own_name_test.go @@ -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 diff --git a/internal/gwbudget/gwbudget.go b/internal/gwbudget/gwbudget.go index eb97f7e57..e90999597 100644 --- a/internal/gwbudget/gwbudget.go +++ b/internal/gwbudget/gwbudget.go @@ -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 diff --git a/internal/gwmw/gwmw.go b/internal/gwmw/gwmw.go index 32a8e21c4..0951ef3fe 100644 --- a/internal/gwmw/gwmw.go +++ b/internal/gwmw/gwmw.go @@ -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 diff --git a/internal/provider/backup.go b/internal/provider/backup.go index 6ad59b99e..cd0e58b60 100644 --- a/internal/provider/backup.go +++ b/internal/provider/backup.go @@ -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.