Repository navigation
Conversation
e7153b0 to
7e5c481
Compare
…outes
The standalone 'local-ai mcp-server' HTTP client (httpapi.Client) called
GET / for both list_installed_models and system_info, expecting the legacy
welcome JSON (ModelsConfig / Version / InstalledBackends). That endpoint was
unregistered when the React UI moved to /app, so GET / now 301-redirects to
the SPA. The client uses LocalAI's hardened httpclient, which refuses all
redirects by default, so both tools failed with:
Get "/app": httpclient: redirect blocked: refusing to follow redirect ...
These two tools have never returned data over HTTP (the client was added
after / became a redirect). Repoint them at live, non-redirecting routes:
- list_installed_models -> GET /api/models/capabilities
(returns id/backend/capabilities/disabled/pinned; also makes the
capability filter, previously a no-op over HTTP, actually work)
- system_info -> GET /version + GET /backends + GET /system
The dead routeWelcome constant is removed and the three new routes are
added as route* constants per the package convention. Test fakes and the
Tool<->REST drift map in coverage_test.go are updated to the new routes,
and new specs cover list_installed_models (all / filtered / empty) and
system_info (version + backends + loaded models).
Assisted-by: LocalAI-Agent:qwen3.8-27b-heretic-abliterated-uncensored
Signed-off-by: L0ria <loria@hno3.eu>
7e5c481 to
d123083
Compare
Conventions audit against
|
Format the HTTP route constants with gofmt. Assisted-by: Codex:gpt-6
|
@mudler Code-review sign-off at |
|
I am unable to autonomously resolve the CI failures. Human assistance required. Why (DCO failure is not on my commit):
Second blocker (merge conflict): Suggested human action (either path unblocks the PR):
No code changes were made by me in this pass — the failure is entirely on the bot-authored commit + upstream drift. |
Summary
The standalone
local-ai mcp-server(the stdio MCP server that talks to aLocalAI instance over its REST API) has two tools that never returned data
over HTTP:
list_installed_modelsandsystem_info.The symptom
Both tools failed with:
Root cause
httpapi.Client(the HTTP client used by the standalone MCP server) calledGET /for both tools, expecting the legacy welcome JSON(
ModelsConfig/Version/InstalledBackends):pkg/mcp/localaitools/httpapi/client.go—ListInstalledModelsandSystemInfoboth usedrouteWelcome = "/".But the welcome endpoint was unregistered when the React UI moved to
/app, soGET /now 301-redirects to the SPA. The client uses LocalAI'shardened
httpclient, which refuses all redirects by default(
pkg/httpclientNoRedirect), so the redirect is rejected and the callfails.
Git history confirms the client was added after
/became a redirect, sothese two tools have never worked over HTTP. The in-server Assistant is
unaffected because it uses a different in-process client that reads memory,
not HTTP.
The fix
Repoint the two methods at live, non-redirecting routes:
list_installed_modelsGET /(welcome JSON)GET /api/models/capabilitiessystem_infoGET /(welcome JSON)GET /version+GET /backends+GET /systemBonus:
list_installed_modelsnow actually honors thecapabilityfilter(it was a documented no-op over HTTP before), and returns
capabilities,disabled, andpinnedin addition toname/backend.The dead
routeWelcomeconstant is removed. Test fakes and the Tool↔RESTdrift map in
coverage_test.goare updated to the new routes, and new specscover
list_installed_models(all / filtered / empty) andsystem_info(version + backends + loaded models).
Verification
go build ./cmd/local-ai— clean.go vet+go test ./pkg/mcp/localaitools/...— all green(
localaitools,httpapi,inproc).local-ai mcp-server --target <live>over stdioagainst a running instance:
list_installed_models→ 96 models with backend + capabilitieslist_installed_models capability=tts→ 5 (filter works)system_info→ version, loaded_models, installed_backends all populatedFiles changed
pkg/mcp/localaitools/httpapi/client.go— repoint the two methodspkg/mcp/localaitools/httpapi/routes.go— droprouteWelcomepkg/mcp/localaitools/httpapi/client_test.go— fakes + new specspkg/mcp/localaitools/coverage_test.go— update the Tool↔REST mappkg/mcp/localaitools/parity_test.go— update the parity fake