ui: fix mcp panel for toggle + timeout + proxy + ON/OFF state#25631
ui: fix mcp panel for toggle + timeout + proxy + ON/OFF state#25631ServeurpersoCom wants to merge 6 commits into
Conversation
Restore the llama-server proxy switch in the Add New Server dialog. The dialog never passed useProxy/onUseProxyChange to McpServerForm, which only renders the proxy switch when the handler is provided. The flag is now wired, persisted on addServer, and reset on close. Bound the MCP connection handshake with the configured timeout. handshakeTimeoutMs was set in the server config but never consumed. The SDK timeout only covers the initialize request, not transport.start(), which can hang forever on an unreachable host. The whole handshake now races against the timeout and closes the transport on expiry so the underlying fetch or socket is aborted. Keep disabled MCP servers visible in management and chat-add UIs. Collapsing mcpDefaultServerOverrides into mcpServers[i].enabled turned the visibleMcpServers enabled filter into a visibility trap: toggling a server off outside a conversation hid it from every surface with no way to re-enable it. The filter is dropped, tools derived from health checks still skip disabled servers, and the settings page and server card render the real card instead of a skeleton for disabled servers that never receive a startup health check.
Remove the visibleMcpServers getter, a filterless alias of getServers whose name invites the next refactor to put a filter back. Call sites read getServers directly, the duplicate list in the chat submenu is merged, and the misleading local variable in the sheet is renamed. A parser unit test pins the invariant: enabled is an on/off state, never a visibility filter, so disabled servers stay listed and toggleable.
|
I make some UI manual stress test... |
The per-server requestTimeoutSeconds field was never editable in any UI and froze the global setting at server creation time, so changing the timeout in Settings was a no-op for existing servers. The field is removed from the data model and parsers, the timeout is read live from the global setting wherever a request config is built, and the misleading "Can be overridden per server" help text is dropped. A parser unit test guards against reintroducing the stored field.
|
Built commit c26d5d1 and tested all the changes with my configuration, existing data clients, and new browser sessions. Most of the weirdness is gone, but noticed that new chats always start with all MCP servers off, even if they're enabled in the MCP page. The timeouts worked, I set mine to 10s in the server json config now, and tested what happens, all good. If you want me to open a seperate issue for that new chat weirdness, let me know. |
You're right, I had already noticed this issue, and I'll take the opportunity to fix it here while the commit is small, that way, we won't forget about it. |
The MCP section held a single setting. The timeout is a global tool execution parameter like the other Agentic entries, so it moves there and the section is removed. Same settings key, no migration needed.
The agenticMaxToolPreviewLines setting was read into AgenticConfig and consumed by nothing: the agentic loop only uses enabled and maxTurns. Its help text described a previous architecture where only truncated previews and the final response survived the loop; tool results and intermediate turns now persist as full DB messages, so the setting had no effect at any value. Stale keys in localStorage or a server ui-config are ignored.
New conversations started with every MCP server off: the settings rework stopped seeding a per-conversation override list, assuming the enabled check would fall back to mcpServers[i].enabled, but it fell back to false, and the send path passed the raw stored list with no fallback at all. The per-conversation list is now sparse by contract, holding only explicit toggles, and every access point resolves a missing entry to the server's own enabled flag: the toggle display, the resolved list handed to the agentic flow, and the enabled check itself.
|
@bill88t can you try again? New conversations should now inherit the MCP page toggles, and per-conversation enable/disable should stick. |

Overview
Fixes MCP panel issues :
Also includes cleanups :
Additional information
Also includes a small cleanup with a unit test to prevent the server on/off toggle bug from reappearing.
Fixes #25625
Thanks @bill88t for testing
Requirements