Skip to content

Commit 3e3aa8c

Browse files
andyjmorganclaude
andcommitted
revert: remove bridge-level ping interception
Pings should go all the way through to the sandbox MCP server process. If a server can't handle ping, that's important diagnostic information that shouldn't be masked at the bridge level. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9d8eb14 commit 3e3aa8c

1 file changed

Lines changed: 0 additions & 15 deletions

File tree

src/DonkeyWork.CodeSandbox.McpServer/Services/StdioBridge.cs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,6 @@ void Emit(string eventType, string message, Action<McpStartEvent>? configure = n
188188
// Extract method name for logging
189189
var method = ExtractMethod(jsonRpcRequest);
190190

191-
// Handle ping at the bridge level - not all MCP servers respond to ping
192-
if (method == "ping")
193-
{
194-
_logger.LogInformation("Handling ping request id={Id} at bridge level", requestId);
195-
lock (_stateLock) _lastRequestAt = DateTime.UtcNow;
196-
var rawId = ExtractRawId(jsonRpcRequest);
197-
return $"{{\"jsonrpc\":\"2.0\",\"result\":{{}},\"id\":{rawId}}}";
198-
}
199-
200191
_logger.LogInformation("Sending request id={Id} method={Method}, registering TCS", requestId, method);
201192

202193
// Register the TCS BEFORE writing to stdin to avoid a race where
@@ -648,12 +639,6 @@ private static bool IsNotification(string json)
648639
}
649640
}
650641

651-
private static string ExtractRawId(string json)
652-
{
653-
using var doc = JsonDocument.Parse(json);
654-
return doc.RootElement.GetProperty("id").GetRawText();
655-
}
656-
657642
private static string? ExtractMethod(string json)
658643
{
659644
try

0 commit comments

Comments
 (0)