From b274ddd28ebfa9e73e94f9dbee46750abdce3e9d Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 1 Oct 2026 11:15:20 +0800 Subject: [PATCH] =?UTF-8?q?plugin:=20a=20move's=20check=20still=20goes=20t?= =?UTF-8?q?hrough=20the=20account's=20proxy,=20now=20that=20it=20reads=20u?= =?UTF-8?q?sage=20too=20=E2=80=94=20TestPluginProxy=20took=20the=20check's?= =?UTF-8?q?=20last=20request=20for=20its=20models;=20the=20check=20asks=20?= =?UTF-8?q?for=20the=20models=20and=20then=20the=20usage,=20so=20the=20tes?= =?UTF-8?q?t=20now=20looks=20for=20both=20among=20what=20the=20account's?= =?UTF-8?q?=20own=20proxy=20saw.=20renderExcluded's=20comment=20goes=20bac?= =?UTF-8?q?k=20over=20renderExcluded=20rather=20than=20over=20renderMovabl?= =?UTF-8?q?e.=20go=20vet,=20go=20test=20-tags=20nogui=20./...=20pass.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/gui/assets/app.js | 4 ++-- internal/plugin/plugin_test.go | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/gui/assets/app.js b/internal/gui/assets/app.js index 787a53bee..f9e8a7040 100644 --- a/internal/gui/assets/app.js +++ b/internal/gui/assets/app.js @@ -2263,8 +2263,6 @@ async function switchProvider(p, on, s) { } } -// Sign-ins magpie found but leaves alone, so nobody wonders why an agent that -// is clearly logged in is not in the list: the ones the user removed. // renderMovable: one quiet line over the list naming the built-in // subscriptions a community plugin can run, and Review, which opens the // first one's editor at its Runs on. Hidden, it stays hidden until another @@ -2292,6 +2290,8 @@ function renderMovable() { box.append(line); } +// Sign-ins magpie found but leaves alone, so nobody wonders why an agent that +// is clearly logged in is not in the list: the ones the user removed. function renderExcluded() { const box = $("#excluded"); box.replaceChildren(); diff --git a/internal/plugin/plugin_test.go b/internal/plugin/plugin_test.go index fc4a3aa2c..65e219933 100644 --- a/internal/plugin/plugin_test.go +++ b/internal/plugin/plugin_test.go @@ -382,8 +382,15 @@ func TestPluginProxy(t *testing.T) { t.Fatalf("usage with its own proxy: %+v, %v", u, err) } // a move's check of the account asks the vendor as its requests do - if ms, err := Check(mine, "fakeco", ""); err != nil || !slices.Contains(ms, "fake-own") || last(&own) != "http://vendor.invalid/models" { - t.Fatalf("a check with its own proxy: %v, %v", ms, err) + mu.Lock() + own = nil + mu.Unlock() + c, err := Check(mine, "fakeco", "") + mu.Lock() + asked := slices.Clone(own) + mu.Unlock() + if err != nil || !slices.Contains(c.Models, "fake-own") || !slices.Contains(asked, "http://vendor.invalid/models") || !slices.Contains(asked, "http://vendor.invalid/usage") { + t.Fatalf("a check with its own proxy: %+v, %v; the proxy saw %q", c, err, asked) } // direct: vendor.invalid can't be reached but through a proxy mu.Lock()