Repository navigation
fix(core): correct AMD discovery and MCP/P2P handling - #13044
Merged
Merged
Conversation
mudler
previously approved these changes
Nov 2, 2026
| // generates a token, and a test parses it against the CLI so it cannot drift | ||
| // from the command tree again (it named the pre-v4 `worker` command for a | ||
| // release cycle). | ||
| const p2pWorkerCommand = "local-ai p2p-worker p2p-llama-cpp-rpc" |
getAMDGPUMemory only asked rocm-smi. ROCm 7+ images no longer ship it (only amd-smi, whose Python module is missing in the image), so on an AMD Strix Halo (gfx1151, ROCm 10.1 image) GET /api/resources returned "gpus": null and aggregate.gpu_count 0, and the Models page said "No GPU found. Fit is measured against 122.7 GB of memory" while inference ran on the GPU. The amdgpu driver exposes the same figures in sysfs, readable inside the container: /sys/class/drm/card0/device/vendor 0x1002 /sys/class/drm/card0/device/mem_info_vram_total 536870912 /sys/class/drm/card0/device/mem_info_vram_used 240300032 /sys/class/drm/card0/device/mem_info_gtt_total 128849018880 /sys/class/drm/card0/device/mem_info_gtt_used 33055911936 When rocm-smi is absent or reports nothing, walk the DRM tree with the existing scanSysfsGPUs (cardN only, connectors skipped, vendor 0x1002) and report every card that has mem_info_vram_total. The GPU report is built by one helper shared with the rocm-smi parser, so the shared-memory APU rule from #12058 (GTT >= 8x VRAM folds GTT into the totals) applies identically. GetResourceInfo, GetGPUAggregateInfo and the fit check all read GetGPUMemoryUsage, so they now see the GPU; DetectGPUVendor already consulted sysfs. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de> (cherry picked from commit bf222ca)
A tool call through an MCP connector was cut after the connector package default of 60 seconds, while the model's own MCP servers allow 360 seconds. Research and document tools behind a connector take minutes, so a saved agent lost them mid-turn with "connection closed: calling tools/call: client is closing" and the model fell back to a weaker tool. The connector service now gets the MCP tool timeout the rest of LocalAI uses (DistributedConfig.MCPToolTimeoutOrDefault, 360 s by default). The package default and the per-call output cap are unchanged. Tests in core/application start the connector service on JSON stores against a slow MCP server: the timeout defaults to the MCP tool timeout, a tool slower than the old cap but within the timeout returns, and a tool past the timeout is still stopped. Docs: chats-connectors.md, "How chats use them". Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Stefan Walcz <stefan.walcz@walcz.de> (cherry picked from commit 99f663a)
Root cause: #9124 moved the llama.cpp P2P worker under `p2p-worker` and made `worker` the generic distributed worker, but the hint printed after `run --p2p`, the Swarm page's command builder and the docs kept the old `local-ai worker p2p-llama-cpp-rpc`, which the parser now rejects with "unexpected argument p2p-llama-cpp-rpc". The MLX shard command had the same stale prefix. The hint becomes a constant that a test parses against the real CLI tree, so the printed command cannot drift from the command set again. Fixes #13032 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Vivek1898 <viveksingh27795@gmail.com> (cherry picked from commit 3c11ab9) Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Root cause: #5889 changed the comparison to `!= "true"` while the result still feeds ResourceLimit.Enable directly, so the libp2p resource manager was enabled when the variable was unset and disabled when it was set to "true" -- the opposite of the docs, and of the debug example that the same PR added. Extract newNodeConfig from newNodeOpts so the environment parsing can be covered by a test. Fixes #13031 Assisted-by: Claude:claude-fable-5-1 Signed-off-by: Vivek1898 <viveksingh27795@gmail.com> (cherry picked from commit 404f861)
The function templates stored the few-shot JSON sample inside a Go raw
string that still had an extra pair of braces. text/template printed
that literal, so the prompt showed {{"example_name": "example_value"}}
and models copied invalid JSON.
Fixes #12890
Signed-off-by: leilei3167 <imleilei123@gmail.com>
(cherry picked from commit 72f1dc2)
Name the MCP tool explicitly so the Ginkgo-only lint rule does not mistake its Run method for testing.T.Run. Assisted-by: nib:gpt-6.1-sol Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Pass the resource-limit choice through application and node configuration. Keep only the exact string true enabled, including worker and explorer entry points. Leave other legacy environment reads unchanged. Assisted-by: nib:gpt-6.1-sol Signed-off-by: Ettore Di Giacinto <mudler@localai.io> Assisted-by: Claude Code:claude-sonnet-5-5
Describe the 1.2-second case as success within its configured timeout, not as exceeding the actual 60-second connector default. Remove trailing whitespace from the P2P command example. Assisted-by: nib:gpt-6.1-sol Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
kong derives a flag name from the Go field name, so the P2PEnableLimits fields were exposed as --p-2-p-enable-limits. The docs and the help text describe --p2p-enable-limits. Set the name on the four commands that take it (run, explorer, and the llama.cpp and MLX P2P workers) and parse the documented spelling in the CLI boundary test. Assisted-by: Claude Code:claude-sonnet-5-5 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
mudler
force-pushed
the
fix/small-pr-validation-batch
branch
from
November 3, 2026 09:22
189dafb to
438e526
Compare
This was referenced Nov 3, 2026
2 tasks done
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Combine five focused fixes, rebased on current master:
p2p-workercommands; the oldlocal-ai worker p2p-llama-cpp-rpcis rejected by the parser.LOCALAI_P2P_ENABLE_LIMITSistrue, as documented. The old code enabled them when the variable was nottrue.{{...}}).Original authors and sign-offs are kept (Stefan Walcz, Vivek1898, leilei3167). Maintainer commits on top: pass the limits choice through application and node configuration, test cleanups, and the changes below.
Changes made while taking the PR over:
core/cli/run.go(flag list) resolved by keeping master's flags and adding the new one.p2pWorkerCommandconstant was flagged by gosec G101 ("potential hardcoded credentials": the name containspw). Renamed toworkerJoinCommand; gosec reports no G101 incore/clinow.P2PEnableLimitsfields were exposed as--p-2-p-enable-limits, not the--p2p-enable-limitsthe docs describe. Set the flag name explicitly onrun,explorerand both P2P workers, with a test that parses the documented spelling (it fails without the fix).Notes for Reviewers
The MCP timeout reuses the distributed config value
MCPToolTimeout(default 360 s) for connectors in every mode. Resource limits are now off by default, which is the documented behaviour; before, they were on by default.Local verification (Go 1.2x, generated protobuf sources, placeholder UI dist):
Not run locally: browser e2e (
add-node,addon-navigation), the Docker-based backend e2e suite, real AMD hardware.Signed commits