Title: fix(mcp): keep last-known-good tools instead of flashing red on a transient failure by waleedlatif1 · Pull Request #5839 · simstudioai/sim · GitHub
Open Graph Title: fix(mcp): keep last-known-good tools instead of flashing red on a transient failure by waleedlatif1 · Pull Request #5839 · simstudioai/sim
X Title: fix(mcp): keep last-known-good tools instead of flashing red on a transient failure by waleedlatif1 · Pull Request #5839 · simstudioai/sim
Description: Summary A connected MCP server with cached tools was showing red "Failed to discover MCP tools" on a single transient discovery probe — even though the backend stored status was connected with a valid tool count (verified in the DB while the UI showed red). It made healthy servers look like they "fail all the time" as probes oscillated against the origin's intermittent stalls. Two coordinated client-side display fixes: useMcpToolsQuery no longer discards React Query's retained data on error — it kept the last successful tools around and we were throwing them away (if (result.data && !result.isError) → if (result.data)). The per-server error still rides in toolsStateByServer. showDiscoveryError only hard-reds when there are genuinely no tools to show (tools.length === 0). A populated, connected server stays on its tool count through a transient blip; a persistent failure still reads as failed via the stored connectionStatus (gated by MAX_CONSECUTIVE_FAILURES). Validated against primary sources before changing (I'd over-corrected this exact condition in #5829): the MCP spec's discover-once + tools/list_changed model, plus the actual behavior of Claude Code (which shipped this same fix as a bug removal — a transient failure no longer flags a healthy server), LibreChat (returns already-fetched tools rather than discarding; guards against overwriting with empty), OpenCode (if (!listed) return, leaves tools intact), and VS Code (persistent tool cache). None blanks a populated server on a transient tools/list failure over a live connection. This supersedes the #5829 over-correction. Type of Change Bug fix (UX / correctness of display) Testing New useMcpToolsQuery test: last-known-good tools survive a failing refetch (with the per-server error still exposed). 16 MCP query + settings tests green; tsc + biome clean. Checklist Code follows project style guidelines Self-reviewed my changes Tests added/updated and passing No new warnings introduced I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Open Graph Description: Summary A connected MCP server with cached tools was showing red "Failed to discover MCP tools" on a single transient discovery probe — even though the backend stored status was connected...
X Description: Summary A connected MCP server with cached tools was showing red "Failed to discover MCP tools" on a single transient discovery probe — even though the backend stored status was c...
Opengraph URL: https://github.com/simstudioai/sim/pull/5839
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:4cd831fa-cfdb-309e-3799-67a0edae233c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9460:3AA4EE:731052:A52D52:6A637B8B |
| html-safe-nonce | f9ac8a4051d33cfd571b8c790747f8fb6353bed2812b9ef6717fc333dbb7bd3d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NDYwOjNBQTRFRTo3MzEwNTI6QTUyRDUyOjZBNjM3QjhCIiwidmlzaXRvcl9pZCI6IjY1NzA0NTc2MDg3OTMyODEzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | ff77b43a26d65c1b991fec5be1022f300c02a9f9359e48b463b352a7bea52e5a |
| hovercard-subject-tag | pull_request:4105634122 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/5839/files |
| twitter:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40672544?s=400&v=4 |
| og:image:alt | Summary A connected MCP server with cached tools was showing red "Failed to discover MCP tools" on a single transient discovery probe — even though the backend stored status was connected... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4c1de337de00c7969335f8866af41463301071379a3a15fba12e9b85aa6378d6 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a4df32552e4c631011bdcd4c81cc3d7408664a8b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width