Laufzeiten: die MCP-Bruecke ist auch ohne Starter in der Sandbox (#712)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Richard
2026-09-25 22:59:56 +02:00
co-authored by Claude Opus 5.5
parent a76983aa28
commit 7a8852fe6b
6 changed files with 26 additions and 4 deletions
@@ -452,6 +452,20 @@ public sealed class ForeignRuntimeTests : IDisposable
sandbox.Request.Environment["CLAWD_TASK_ID"].ShouldBe("t-7");
}
[Fact]
public void With_mcp_the_bridge_is_there_even_without_the_launcher()
{
// No network, no secrets — no launcher. The command still calls $CLAWD_HELPER.
_agent.Runtime = new AgentRuntimeConfig { Kind = RuntimeKinds.Command, Command = "/bin/sh" };
var request = new CommandRuntime().Prepare(Context());
request.NeedsLauncher.ShouldBeFalse();
request.ReadOnlyPaths.ShouldContain("/opt/clawd");
request.Environment["CLAWD_HELPER"].ShouldBe("/opt/clawd/ClawdDotNet");
request.Environment["DOTNET_ROOT"].ShouldBe("/usr/lib/dotnet");
}
[Fact]
public async Task A_failing_command_is_a_failed_run_with_its_reason()
{
@@ -170,7 +170,7 @@ public sealed class McpSocketTests : IDisposable
"""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" """,
"""printf '%s\n' "$m1" "$m2" "$m3" | "$CLAWD_HELPER" --mcp-bridge --socket "$CLAWD_MCP_SOCKET" 2>&1""",
"echo done > /work/result.txt");
var agent = new AgentConfig
{