Repository navigation
Commit 13dd40a
fix(mcp): retry listTools() before evicting client on transient failure
Previously, a single transient listTools() failure (timeout, pipe hiccup, GC
pause) would permanently delete the MCP client from the session state with no
retry or reconnection mechanism. This caused MCP tools to silently vanish
mid-session while the server process was still running.
This commit:
1. Adds retry logic (3 attempts with 1s delay) before marking a client as failed
2. Removes the immediate 'delete s.clients[clientName]' that permanently evicted
healthy servers on transient errors
3. Logs retry attempts at warn level for visibility
The client remains in 'failed' status after all retries are exhausted, but is
no longer deleted, allowing future state() calls to attempt reconnection.
Fixes anomalyco#170991 parent d8fbe0a commit 13dd40a
1 file changed
Lines changed: 43 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
30 | 55 | | |
31 | 56 | | |
32 | 57 | | |
| |||
620 | 645 | | |
621 | 646 | | |
622 | 647 | | |
623 | | - | |
624 | | - | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
625 | 664 | | |
626 | 665 | | |
627 | 666 | | |
628 | 667 | | |
629 | 668 | | |
630 | | - | |
| 669 | + | |
| 670 | + | |
631 | 671 | | |
632 | 672 | | |
633 | 673 | | |
| |||
0 commit comments