From 39b3e9bb7d38e4ece26052a1f9c912f923397ad4 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 4 Nov 2026 02:23:47 +0000 Subject: [PATCH] test: fix the mock chat window, the MCP route scan and the add-on index A chat now reports the window of its model, so the mock model with no context_size got the 4096 default and the tool schemas of a chat no longer fit: six Chats specs got no answer. Give the mock model a window that fits. The MCP route scan read every file under the package, including the test binaries that a macOS run builds there, and found the route names in them. It reads only Go source now. Regenerate the add-on library index for the new Memory description. Assisted-by: Claude:claude-sonnet-5-5 go ginkgo sh --- gallery/addons/index.yaml | 16 ++++++++-------- pkg/mcp/localaitools/hostgrants_unmapped_test.go | 3 ++- tests/e2e/e2e_suite_test.go | 3 +++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gallery/addons/index.yaml b/gallery/addons/index.yaml index 16847f130d..34754313d8 100644 --- a/gallery/addons/index.yaml +++ b/gallery/addons/index.yaml @@ -332,7 +332,7 @@ - "review-comment-pr" - id: "memory" name: Short memory - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." version: "0.0.0-development" channel: "development" artifact: "oci://quay.io/go-skynet/local-ai-addons:memory-development" @@ -345,12 +345,12 @@ identity: "https://github.com/mudler/LocalAI/.github/workflows/addons-package.yml@refs/heads/master" ui: title: "Short memory" - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." mainPage: "memory" icon: "ui/icon.png" - id: "memory" name: Short memory - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." version: "0.0.0-development" channel: "development" artifact: "oci://quay.io/go-skynet/local-ai-addons:memory-development" @@ -363,12 +363,12 @@ identity: "https://github.com/mudler/LocalAI/.github/workflows/addons-package.yml@refs/heads/master" ui: title: "Short memory" - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." mainPage: "memory" icon: "ui/icon.png" - id: "memory" name: Short memory - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." version: "0.0.0-development" channel: "development" artifact: "oci://quay.io/go-skynet/local-ai-addons:memory-development" @@ -381,12 +381,12 @@ identity: "https://github.com/mudler/LocalAI/.github/workflows/addons-package.yml@refs/heads/master" ui: title: "Short memory" - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." mainPage: "memory" icon: "ui/icon.png" - id: "memory" name: Short memory - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." version: "0.0.0-development" channel: "development" artifact: "oci://quay.io/go-skynet/local-ai-addons:memory-development" @@ -399,7 +399,7 @@ identity: "https://github.com/mudler/LocalAI/.github/workflows/addons-package.yml@refs/heads/master" ui: title: "Short memory" - description: "Your chats keep short notes about you, read them before they answer, and save a new one only after you confirm it." + description: "Your chats keep short notes about you and read them before they answer. By default a new note is saved only after you confirm it; you can choose to have it saved at once with an Undo, or never." mainPage: "memory" icon: "ui/icon.png" - id: "office" diff --git a/pkg/mcp/localaitools/hostgrants_unmapped_test.go b/pkg/mcp/localaitools/hostgrants_unmapped_test.go index bfce21eb1a..a16a05e27f 100644 --- a/pkg/mcp/localaitools/hostgrants_unmapped_test.go +++ b/pkg/mcp/localaitools/hostgrants_unmapped_test.go @@ -26,7 +26,8 @@ var _ = Describe("host access and the MCP tools", func() { root := "." var hits []string Expect(filepath.Walk(root, func(path string, info os.FileInfo, err error) error { - if err != nil || info.IsDir() || strings.HasSuffix(path, "_test.go") { + // Only source files: a test binary built into the tree holds the names too. + if err != nil || info.IsDir() || !strings.HasSuffix(path, ".go") || strings.HasSuffix(path, "_test.go") { return err } b, rerr := os.ReadFile(path) diff --git a/tests/e2e/e2e_suite_test.go b/tests/e2e/e2e_suite_test.go index 28630c72b7..21a2e0d9bc 100644 --- a/tests/e2e/e2e_suite_test.go +++ b/tests/e2e/e2e_suite_test.go @@ -117,6 +117,9 @@ var _ = BeforeSuite(func() { modelConfig := map[string]any{ "name": "mock-model", "backend": "mock-backend", + // A chat reports the window of the model, and the tool schemas of a + // chat no longer fit in the default one. + "context_size": 32768, "parameters": map[string]any{ "model": "mock-model.bin", },