-
Notifications
You must be signed in to change notification settings - Fork 137
Commit ad5ab58
committed
Add smart timeout protection for Tinker that works on all platforms
The MCP server was crashing when Tinker code ran too long or got stuck in infinite loops. This adds process isolation by default to prevent crashes, but also makes it work differently on Windows vs Linux/Mac since they handle timeouts differently.
What changed:
- Added process isolation config (on by default for safety)
- Windows: Uses process isolation to avoid fatal crashes
- Linux/Mac: Can disable isolation for speed since PCNTL handles timeouts gracefully
- Added tests that skip appropriately on each platform1 parent 0b7ad74 commit ad5ab58
File tree
2 files changed
+45
-13
lines changed- src/Mcp/Tools
- tests/Feature/Mcp/Tools
2 files changed
+45
-13
lines changedLines changed: 18 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
43 | 43 |
| |
44 | 44 |
| |
45 | 45 |
| |
46 | - | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
47 | 54 |
| |
48 | 55 |
| |
49 | - | ||
56 | + | ||
50 | 57 |
| |
51 | 58 |
| |
52 | 59 |
| |
| |||
60 | 67 |
| |
61 | 68 |
| |
62 | 69 |
| |
63 | - | ||
64 | - | ||
65 | - | ||
66 | - | ||
67 | 70 |
| |
68 | - | ||
69 | 71 |
| |
70 | 72 |
| |
71 | 73 |
| |
| |||
81 | 83 |
| |
82 | 84 |
| |
83 | 85 |
| |
84 | - | ||
85 | - | ||
86 | - | ||
87 | - | ||
88 | - | ||
89 | 86 |
| |
90 | 87 |
| |
91 | 88 |
| |
92 | 89 |
| |
93 | 90 |
| |
94 | 91 |
| |
95 | 92 |
| |
93 | + | ||
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
96 | 102 |
| |
97 | 103 |
| |
98 | 104 |
|
Lines changed: 27 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
167 | + | ||
168 | + | ||
169 | + | ||
170 | + | ||
171 | + | ||
172 | + | ||
173 | + | ||
174 | + | ||
167 | 175 |
| |
168 | 176 |
| |
169 | 177 |
| |
| |||
180 | 188 |
| |
181 | 189 |
| |
182 | 190 |
| |
183 | - | ||
191 | + | ||
192 | + | ||
193 | + | ||
194 | + | ||
195 | + | ||
196 | + | ||
197 | + | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | ||
184 | 210 |
| |
185 | 211 |
|
0 commit comments