backstage release v0.128.1
Fixed
- Fix AI chat backend crash on every chat send. The
tools field in the request body is optional, so it arrives as undefined whenever the frontend does not register any client-side tools. The previous implementation called Object.entries(tools) unconditionally, which threw TypeError: Cannot convert undefined or null to object, returning a 500 from POST /api/ai-chat/chat on every request. The browser surfaced this as “network error” and the LLM never reached the tool-merge step, so MCP-provided tools (muster, prometheus, kubernetes, …), skill tools, getDate, and the context-usage tool were also unreachable from chat. frontendTools now accepts null/undefined and treats them as an empty registry. - Rebuild MCP clients when the underlying transport closes. The AI chat backend caches one
MCPClient per server for 30 minutes, but the cache was holding on to clients whose StreamableHTTP transport had already been torn down by muster (idle timeout, server reset, …). Tool calls then failed with MCPClientError: Attempted to send a request from a closed client until the TTL expired, surfacing in the browser as a “network error” banner. The cache now chains into the transport’s onclose callback and evicts the entry as soon as the connection drops, so the next request rebuilds the client cleanly. Tool execution also detects the same SDK error eagerly and marks the entry dead so a single failure – not a 30-minute window – triggers reconnection.
See ./docs/releases/v0.128.1-changelog.md for more information.