diff --git a/tests/ClawdDotNet.Web.Tests/McpSocketTests.cs b/tests/ClawdDotNet.Web.Tests/McpSocketTests.cs index 68b57ef..fb03419 100644 --- a/tests/ClawdDotNet.Web.Tests/McpSocketTests.cs +++ b/tests/ClawdDotNet.Web.Tests/McpSocketTests.cs @@ -165,14 +165,13 @@ public sealed class McpSocketTests : IDisposable var agentDir = Path.Combine(host.InstancePath, "Agents", "Agent-coder"); Directory.CreateDirectory(Path.Combine(agentDir, "Workspace")); - const string script = """ - printf '%s\n' \ - '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}' \ - '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' \ - '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"Echo","arguments":{}}}' \ - | "$CLAWD_HELPER" --mcp-bridge --socket "$CLAWD_MCP_SOCKET" - echo done > /work/result.txt - """; + // One command per line: the file's line endings must not decide what the shell sees. + var script = string.Join("\n", + """m1='{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}'""", + """m2='{"jsonrpc":"2.0","id":2,"method":"tools/list"}'""", + """m3='{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"Echo","arguments":{}}}'""", + """printf '%s\n' "$m1" "$m2" "$m3" | "$CLAWD_HELPER" --mcp-bridge --socket "$CLAWD_MCP_SOCKET" """, + "echo done > /work/result.txt"); var agent = new AgentConfig { AgentId = "coder", AgentDir = agentDir, WorkspacePath = Path.Combine(agentDir, "Workspace"),