- Notifications
You must be signed in to change notification settings - Fork1k
Commitc6efe64
authored
fix: handle nil writer in bash MCP tool (#18978)
- Refactors the bash tool to use `io.Discard` instead of nil to avoid panics.- Enhances panic recovery in `codersdk/toolsdk/toolsdk.go` by adding stack trace information in development builds. When a panic occurs in a tool handler: - In development builds: The error includes the full stack trace for easier debugging - In production builds: A simpler error message is shown without the stack trace1 parentdd2fb89 commitc6efe64
2 files changed
+12
-4
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
79 | 79 |
| |
80 | 80 |
| |
81 | 81 |
| |
82 |
| - | |
| 82 | + | |
83 | 83 |
| |
84 | 84 |
| |
85 | 85 |
| |
86 | 86 |
| |
87 |
| - | |
88 |
| - | |
| 87 | + | |
89 | 88 |
| |
90 | 89 |
| |
91 | 90 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
| 9 | + | |
9 | 10 |
| |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
13 | 14 |
| |
14 | 15 |
| |
| 16 | + | |
15 | 17 |
| |
16 | 18 |
| |
17 | 19 |
| |
| |||
122 | 124 |
| |
123 | 125 |
| |
124 | 126 |
| |
125 |
| - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 |
| |
127 | 136 |
| |
128 | 137 |
| |
|
0 commit comments
Comments
(0)