From 95bd59d78e1aabab1a42d611f717bc9fa2fe56a9 Mon Sep 17 00:00:00 2001 From: "mudler's LocalAI [bot]" <139863280+localai-bot@users.noreply.github.com> Date: Mon, 3 Aug 2026 19:01:40 +0200 Subject: [PATCH] fix(mcp): teach the assistant test stub the scheduling methods (#11318) #11228 added ListScheduling, GetScheduling, SetScheduling and DeleteScheduling to localaitools.LocalAIClient but did not update stubClient, the hand-written test double in the mcp endpoints package. The package therefore fails to typecheck, which takes out both lint and tests on master: cannot use stubClient{} as localaitools.LocalAIClient value in argument to h.Initialize: stubClient does not implement localaitools.LocalAIClient (missing method DeleteScheduling) Red on 8f74f74b, fd4ec083 and 8a68f357; green on cd62e8ff, the commit before. Add the four methods with the same inert bodies the rest of the stub uses. The real implementations are covered in the localaitools suites; this double only exists so the holder can be constructed. Assisted-by: Claude Code:claude-opus-5 [Read] [Edit] [Bash] Signed-off-by: Ettore Di Giacinto Co-authored-by: Ettore Di Giacinto --- .../http/endpoints/mcp/localai_assistant_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/core/http/endpoints/mcp/localai_assistant_test.go b/core/http/endpoints/mcp/localai_assistant_test.go index 213f6fa0c..8543b3b9a 100644 --- a/core/http/endpoints/mcp/localai_assistant_test.go +++ b/core/http/endpoints/mcp/localai_assistant_test.go @@ -154,6 +154,22 @@ func (stubClient) GetRouterDecisions(_ context.Context, _ localaitools.RouterDec return []localaitools.RouterDecision{}, nil } +func (stubClient) ListScheduling(_ context.Context) ([]localaitools.ModelSchedulingConfig, error) { + return []localaitools.ModelSchedulingConfig{}, nil +} + +func (stubClient) GetScheduling(_ context.Context, _ string) (*localaitools.ModelSchedulingConfig, error) { + return &localaitools.ModelSchedulingConfig{}, nil +} + +func (stubClient) SetScheduling(_ context.Context, _ localaitools.SetSchedulingRequest) (*localaitools.ModelSchedulingConfig, error) { + return &localaitools.ModelSchedulingConfig{}, nil +} + +func (stubClient) DeleteScheduling(_ context.Context, _ string) error { + return nil +} + var _ = Describe("LocalAIAssistantHolder", func() { var ctx context.Context