From c1a0726369d0f446a58d8f8fd4ca91d55eeb8fa7 Mon Sep 17 00:00:00 2001 From: yetone Date: Wed, 11 Nov 2026 12:26:42 +0800 Subject: [PATCH] tests: context-cap and the catalog's model list are named in the route and settings guards 747632890 added POST /api/settings/context-cap and settings.ContextCap, and eb56de0b5 added GET /api/catalog/models, with no line in either guard, so TestEveryRouteHasACommandOrIsNamed and TestSettingsSaveKeepsWhatItDoesNotSend were red on CI from 8aae124b0 on (run 42954436265, ubuntu and macOS). context-cap has its command, magpie model context-cap; the catalog list is the model editor's Same as picker, with no command yet (stage 2). The settings-keep test now sets ContextCap, which has its own route, and checks a Settings save keeps it (it does: the test passes with no code change). Run on mote at origin/main 245f07b19 plus this: go test -count=1 ./internal/cli ok (42s). ./internal/gui: both guards ok; the package's red tests there were TestCoreScriptBudget (next commit) and eight AppKit window tests that wait 30s for a window over ssh (TestPanelCloseHidesIt, TestMainWindowCorners and the like), which this change doesn't reach. Red before: both guards on CI at 8aae124b0, naming these three. --- internal/cli/settings_parity_test.go | 2 ++ internal/gui/settings_keep_test.go | 1 + 2 files changed, 3 insertions(+) diff --git a/internal/cli/settings_parity_test.go b/internal/cli/settings_parity_test.go index 7de46c406..0667b8528 100644 --- a/internal/cli/settings_parity_test.go +++ b/internal/cli/settings_parity_test.go @@ -230,6 +230,7 @@ var cliForRoute = map[string]string{ "POST /api/update/check": "magpie update check", "POST /api/settings/agent-compact": "magpie model compact", "POST /api/settings/agent-suffix": "magpie model suffix", + "POST /api/settings/context-cap": "magpie model context-cap", "POST /api/update/install": "magpie update", "GET /api/model-price": "magpie model price", "POST /api/model-price": "magpie model price", @@ -332,6 +333,7 @@ var notYet = map[string]string{ "GET /api/plugins/builtin": P, // builtins.go "POST /api/plugins/builtin": P, // builtins.go "GET /api/plugins/counts": P, // plugins_counts.go: Discover's installs and likes + "GET /api/catalog/models": P, // catalog_models.go: the model editor's Same as picker "POST /api/plugins/like": P, // plugins_counts.go "GET /api/library/browser": L, // browser.go "POST /api/library/browser/setup": L, // browser.go diff --git a/internal/gui/settings_keep_test.go b/internal/gui/settings_keep_test.go index f6bbe0faf..12859932a 100644 --- a/internal/gui/settings_keep_test.go +++ b/internal/gui/settings_keep_test.go @@ -213,6 +213,7 @@ func TestSettingsSaveKeepsWhatItDoesNotSend(t *testing.T) { was.ProxyCustom = "http://me:secret@proxy.example:8080" was.PluginProxyCustom = "http://me:secret@plugins.example:8080" was.PanelShortcut = "Ctrl+Alt+K" + was.ContextCap = 200000 // its own route, POST /api/settings/context-cap was.SearcherThen = []string{"fake/m1", "fake/m2"} // set in its own row was.RouterNote = "Los Angeles" // the Library's servers/hub-note was.RouterAllTools = true // the Library's servers/hub-tools