plugin: a move's check still goes through the account's proxy, now that it reads usage too — TestPluginProxy took the check's last request for its models; the check asks for the models and then the usage, so the test now looks for both among what the account's own proxy saw. renderExcluded's comment goes back over renderExcluded rather than over renderMovable. go vet, go test -tags nogui ./... pass.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user