Skip to content

Commit 2e07c3b

Browse files
author
Aman Rusia
committed
Timeout related fixes: use custom fork of mcp
1 parent f0c60ef commit 2e07c3b

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

pyproject.toml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
authors = [{ name = "Aman Rusia", email = "[email protected]" }]
33
name = "wcgw"
4-
version = "1.5.0"
4+
version = "1.5.1"
55
description = "What could go wrong giving full shell access to chatgpt?"
66
readme = "README.md"
77
requires-python = ">=3.11, <3.13"
@@ -25,7 +25,7 @@ dependencies = [
2525
"semantic-version>=2.10.0",
2626
"nltk>=3.9.1",
2727
"anthropic>=0.39.0",
28-
"mcp>=1.0.0",
28+
"mcp",
2929
]
3030

3131
[project.urls]
@@ -49,3 +49,6 @@ dev-dependencies = [
4949
"ipython>=8.12.3",
5050
"gunicorn>=23.0.0",
5151
]
52+
53+
[tool.uv.sources]
54+
mcp = { git = "https://github.com/rusiaaman/python-sdk", rev = "53b69f397eae6ac81a51b84b34ff52b3119f11cb" }

src/wcgw/client/computer_use.py

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
OUTPUT_DIR = "/tmp/outputs"
2727
TYPING_DELAY_MS = 12
2828
TYPING_GROUP_SIZE = 50
29-
TRUNCATED_MESSAGE: str = "<response clipped><NOTE>To save on context only part of this file has been shown to you.</NOTE>"
3029

3130
Action = Literal[
3231
"key",

src/wcgw/client/mcp_server/server.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
)
3131
from ..computer_use import Computer
3232

33+
tools.TIMEOUT = 3
3334

3435
server = Server("wcgw")
3536

src/wcgw/client/sys_utils.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import subprocess
22

33
MAX_RESPONSE_LEN: int = 16000
4+
TRUNCATED_MESSAGE: str = "<response clipped><NOTE>To save on context only part of this file has been shown to you.</NOTE>"
45

56

67
def maybe_truncate(content: str, truncate_after: int | None = MAX_RESPONSE_LEN) -> str:
@@ -14,7 +15,7 @@ def maybe_truncate(content: str, truncate_after: int | None = MAX_RESPONSE_LEN)
1415

1516
def command_run(
1617
cmd: str,
17-
timeout: float | None = 30.0, # seconds
18+
timeout: float | None = 3.0, # seconds
1819
truncate_after: int | None = MAX_RESPONSE_LEN,
1920
text: bool = True,
2021
) -> tuple[int, str, str]:

src/wcgw/client/tools.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ def read_file(readfile: ReadFile, max_tokens: Optional[int]) -> str:
989989

990990
else:
991991
return_code, content, stderr = command_run(
992-
f"cat {readfile.file_path}",
992+
f"cat {readfile.file_path}", timeout=TIMEOUT
993993
)
994994
if return_code != 0:
995995
raise Exception(

uv.lock

+3-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)