diff --git a/suites/clawbench/suite.py b/suites/clawbench/suite.py index e85b366..122e093 100644 --- a/suites/clawbench/suite.py +++ b/suites/clawbench/suite.py @@ -28,6 +28,12 @@ CLAWBENCH_BROWSER = "/app/src/harbor/kernel-browser.py " HARBOR_BROWSER = "/app/src/harbor/harbor-browser.py " RUNTIME_BLOCK = re.compile(r"\n---\nHarbor browser runtime:\n.*?\n---\n", re.DOTALL) +# ClawBench forbids command-line tools, but agents without a file-read tool +# need a shell to read the task's files. +FILE_ACCESS = ( + "\n---\nReading files with shell commands (for example under `./my-info/`) is " + "allowed. Do everything else through the browser.\n---\n" +) def preflight() -> None: @@ -82,4 +88,4 @@ def _remove_tool_wiring(task_dir: Path) -> None: config["environment"].pop("mcp_servers", None) write_config(task_dir, config) for path in instructions(task_dir): - path.write_text(RUNTIME_BLOCK.sub("\n", path.read_text())) + path.write_text(RUNTIME_BLOCK.sub(FILE_ACCESS, path.read_text())) diff --git a/tests/test_clawbench.py b/tests/test_clawbench.py index 2e1fbd1..c21f0a6 100644 --- a/tests/test_clawbench.py +++ b/tests/test_clawbench.py @@ -21,3 +21,4 @@ def test_generate_runs_on_the_harbor_browser_without_tool_wiring(tmp_path): instruction = (task / "steps" / "run" / "instruction.md").read_text() assert "Harbor browser runtime" not in instruction assert "9223" not in instruction + assert "Reading files with shell commands" in instruction diff --git a/toolsets/kernel-mcp-local/toolset.py b/toolsets/kernel-mcp-local/toolset.py index 15c48aa..a1d8093 100644 --- a/toolsets/kernel-mcp-local/toolset.py +++ b/toolsets/kernel-mcp-local/toolset.py @@ -23,7 +23,7 @@ ## Browser tools - Use the `kernel` MCP server's `execute_playwright_code` tool for all browser interaction. Wait for the server to finish initializing before starting; in Claude Code, call `WaitForMcpServers` if it is still pending. -- Before your first browser call, read your browser's session ID from the file `/run/kernel-mcp/session-id` (reading this one file with a shell command is allowed) and pass it as `session_id` on every call. +- Before your first browser call, read your browser's session ID from the file `/run/kernel-mcp/session-id` and pass it as `session_id` on every call. - Do not create, list, update, or delete browsers, and do not use Kernel managed auth. - Interact through page navigation and DOM/UI actions. Do not call `fetch`, `XMLHttpRequest`, Playwright request APIs, or other HTTP clients inside `execute_playwright_code`. """