inspect-swe 0.2.8__py3-none-any.whl → 0.2.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inspect_swe/_claude_code/claude_code.py +15 -1
- inspect_swe/_claude_code/install/download.py +9 -5
- inspect_swe/_claude_code/install/install.py +3 -1
- inspect_swe/_util/trace.py +4 -1
- inspect_swe/_version.py +2 -2
- {inspect_swe-0.2.8.dist-info → inspect_swe-0.2.10.dist-info}/METADATA +2 -2
- {inspect_swe-0.2.8.dist-info → inspect_swe-0.2.10.dist-info}/RECORD +10 -10
- {inspect_swe-0.2.8.dist-info → inspect_swe-0.2.10.dist-info}/WHEEL +0 -0
- {inspect_swe-0.2.8.dist-info → inspect_swe-0.2.10.dist-info}/entry_points.txt +0 -0
- {inspect_swe-0.2.8.dist-info → inspect_swe-0.2.10.dist-info}/licenses/LICENSE +0 -0
@@ -16,6 +16,8 @@ from inspect_ai.tool import MCPServerConfig
|
|
16
16
|
from inspect_ai.util import sandbox as sandbox_env
|
17
17
|
from pydantic_core import to_json
|
18
18
|
|
19
|
+
from inspect_swe._util.trace import trace
|
20
|
+
|
19
21
|
from .._util._async import is_callable_coroutine
|
20
22
|
from .install.install import ensure_claude_code_installed
|
21
23
|
|
@@ -93,6 +95,8 @@ def claude_code(
|
|
93
95
|
cmd = [
|
94
96
|
"--print", # run without interactions
|
95
97
|
"--dangerously-skip-permissions",
|
98
|
+
"--debug",
|
99
|
+
"--verbose",
|
96
100
|
"--model",
|
97
101
|
model,
|
98
102
|
]
|
@@ -129,7 +133,8 @@ def claude_code(
|
|
129
133
|
# resolve sandbox
|
130
134
|
sbox = sandbox_env(sandbox)
|
131
135
|
|
132
|
-
# execute the agent
|
136
|
+
# execute the agent (track debug output)
|
137
|
+
debug_output: list[str] = []
|
133
138
|
agent_prompt = prompt
|
134
139
|
attempt_count = 0
|
135
140
|
while True:
|
@@ -157,8 +162,13 @@ def claude_code(
|
|
157
162
|
}
|
158
163
|
| (env or {}),
|
159
164
|
user=user,
|
165
|
+
concurrency=False,
|
160
166
|
)
|
161
167
|
|
168
|
+
# track debug output
|
169
|
+
debug_output.append(result.stdout)
|
170
|
+
debug_output.append(result.stderr)
|
171
|
+
|
162
172
|
# raise for error
|
163
173
|
if not result.success:
|
164
174
|
f"Error executing claude code agent: {result.stdout}\n{result.stderr}"
|
@@ -188,6 +198,10 @@ def claude_code(
|
|
188
198
|
else:
|
189
199
|
agent_prompt = attempts.incorrect_message
|
190
200
|
|
201
|
+
# trace debug info
|
202
|
+
debug_output.insert(0, "Claude Code Debug Output:")
|
203
|
+
trace("\n".join(debug_output))
|
204
|
+
|
191
205
|
return bridge.state
|
192
206
|
|
193
207
|
# return agent with specified name and descritpion
|
@@ -1,12 +1,11 @@
|
|
1
1
|
import re
|
2
|
-
from typing import Literal
|
2
|
+
from typing import Callable, Literal
|
3
3
|
|
4
4
|
from pydantic import BaseModel
|
5
5
|
|
6
6
|
from ..._util.checksum import verify_checksum
|
7
7
|
from ..._util.download import download_file, download_text_file
|
8
8
|
from ..._util.sandbox import SandboxPlatform
|
9
|
-
from ..._util.trace import trace
|
10
9
|
from .cache import (
|
11
10
|
read_cached_claude_code_binary,
|
12
11
|
write_cached_claude_code_binary,
|
@@ -14,8 +13,13 @@ from .cache import (
|
|
14
13
|
|
15
14
|
|
16
15
|
async def download_claude_code_async(
|
17
|
-
version: Literal["stable", "latest"] | str,
|
16
|
+
version: Literal["stable", "latest"] | str,
|
17
|
+
platform: SandboxPlatform,
|
18
|
+
logger: Callable[[str], None] | None = None,
|
18
19
|
) -> bytes:
|
20
|
+
# resovle logger
|
21
|
+
logger = logger or print
|
22
|
+
|
19
23
|
# determine version and checksum
|
20
24
|
gcs_bucket = await _claude_code_gcs_bucket()
|
21
25
|
version = await _claude_code_version(gcs_bucket, version)
|
@@ -35,9 +39,9 @@ async def download_claude_code_async(
|
|
35
39
|
write_cached_claude_code_binary(binary_data, version, platform)
|
36
40
|
|
37
41
|
# trace
|
38
|
-
|
42
|
+
logger(f"Downloaded claude code binary: {version} ({platform})")
|
39
43
|
else:
|
40
|
-
|
44
|
+
logger(f"Used claude code binary from cache: {version} ({platform})")
|
41
45
|
|
42
46
|
# return data
|
43
47
|
return binary_data
|
@@ -50,7 +50,9 @@ async def ensure_claude_code_installed(
|
|
50
50
|
|
51
51
|
# download the binary
|
52
52
|
if claude_binary_bytes is None:
|
53
|
-
claude_binary_bytes = await download_claude_code_async(
|
53
|
+
claude_binary_bytes = await download_claude_code_async(
|
54
|
+
version, platform, trace
|
55
|
+
)
|
54
56
|
|
55
57
|
# write it into the container and return it
|
56
58
|
claude_binary = f"/opt/claude-{version}-{platform}"
|
inspect_swe/_util/trace.py
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
from logging import getLogger
|
2
2
|
|
3
|
+
from inspect_ai.util import trace_message
|
4
|
+
|
3
5
|
logger = getLogger(__file__)
|
4
6
|
|
5
7
|
|
6
8
|
def trace(message: str) -> None:
|
7
|
-
logger.
|
9
|
+
logger.setLevel("TRACE")
|
10
|
+
trace_message(logger, category="Inspect SWE", message=message)
|
inspect_swe/_version.py
CHANGED
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
28
28
|
commit_id: COMMIT_ID
|
29
29
|
__commit_id__: COMMIT_ID
|
30
30
|
|
31
|
-
__version__ = version = '0.2.
|
32
|
-
__version_tuple__ = version_tuple = (0, 2,
|
31
|
+
__version__ = version = '0.2.10'
|
32
|
+
__version_tuple__ = version_tuple = (0, 2, 10)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: inspect_swe
|
3
|
-
Version: 0.2.
|
3
|
+
Version: 0.2.10
|
4
4
|
Summary: Software engineering agents for Inspect AI.
|
5
5
|
Project-URL: Documentation, https://meridianlabs-ai.github.io/inspect_swe/
|
6
6
|
Project-URL: Source Code, https://github.com/meridianlabs-ai/inspect_swe
|
@@ -10,7 +10,7 @@ License: MIT License
|
|
10
10
|
License-File: LICENSE
|
11
11
|
Requires-Python: >=3.10
|
12
12
|
Requires-Dist: httpx
|
13
|
-
Requires-Dist: inspect-ai>=0.3.
|
13
|
+
Requires-Dist: inspect-ai>=0.3.129
|
14
14
|
Requires-Dist: nest-asyncio
|
15
15
|
Requires-Dist: platformdirs
|
16
16
|
Requires-Dist: pydantic>=2.11.4
|
@@ -1,13 +1,13 @@
|
|
1
1
|
inspect_swe/__init__.py,sha256=yJ9tBcF2Wy11mVmLh1fTYXgYcsSHv30GAW-tVwE-r3s,342
|
2
2
|
inspect_swe/_registry.py,sha256=jM37ysrY39Ufd67GRKbiwfSViOLlm-82lm_JEaWKshw,97
|
3
|
-
inspect_swe/_version.py,sha256=
|
3
|
+
inspect_swe/_version.py,sha256=zeAv0wS82sAYrTjvb2legvXh_NAYY8l7F03H7pgMggQ,706
|
4
4
|
inspect_swe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
inspect_swe/_claude_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
6
|
-
inspect_swe/_claude_code/claude_code.py,sha256=
|
6
|
+
inspect_swe/_claude_code/claude_code.py,sha256=jmQuXDXtdbMvqkXS57to5aol2d1g38BrmBng8-iuWhY,10419
|
7
7
|
inspect_swe/_claude_code/install/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
inspect_swe/_claude_code/install/cache.py,sha256=k08bCxGq-iYVpO16LNQhPjxTM9p2iecpqMjqYd2WBss,1708
|
9
|
-
inspect_swe/_claude_code/install/download.py,sha256=
|
10
|
-
inspect_swe/_claude_code/install/install.py,sha256=
|
9
|
+
inspect_swe/_claude_code/install/download.py,sha256=AKyyaaWAinoSsrb4m07IqCyF74eHISNDcuv3Z3jF-S8,3301
|
10
|
+
inspect_swe/_claude_code/install/install.py,sha256=RZuRYB7SVqvZXgmNzJYAYRogHZv8z4NiTXx1y0j6f0A,2520
|
11
11
|
inspect_swe/_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
12
12
|
inspect_swe/_tools/download.py,sha256=Jn_gcFR5Kw2vTYA1dWOFYRpqFtoFnKFv2Kv-4xT8tz4,1283
|
13
13
|
inspect_swe/_util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -19,9 +19,9 @@ inspect_swe/_util/constants.py,sha256=xKvGgaJ0MwNbdzaken5HMbxYyKBEw_3VrBwCgkvAIW
|
|
19
19
|
inspect_swe/_util/download.py,sha256=cCUau4ZBOKezpotJV5-v3JY_5CuYDZ-VcWlLf_EyNL0,340
|
20
20
|
inspect_swe/_util/platform.py,sha256=wm4efIFfdyTeaV2oxOXVvYl1u22MHX3jQMERHJMgv7A,339
|
21
21
|
inspect_swe/_util/sandbox.py,sha256=2wYmVz5EGUDBhqbN3NgLAOsyKeU-KRI161MZMJ54n4M,1769
|
22
|
-
inspect_swe/_util/trace.py,sha256=
|
23
|
-
inspect_swe-0.2.
|
24
|
-
inspect_swe-0.2.
|
25
|
-
inspect_swe-0.2.
|
26
|
-
inspect_swe-0.2.
|
27
|
-
inspect_swe-0.2.
|
22
|
+
inspect_swe/_util/trace.py,sha256=bZJlTqb9PSBAFm9RcJrC5dxJKoCvbll3ctWBT5ngNFE,234
|
23
|
+
inspect_swe-0.2.10.dist-info/METADATA,sha256=l-iD0cto0nL0FhuB7otukrKc2XaE3FINncuVz_Lj5a0,1725
|
24
|
+
inspect_swe-0.2.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
25
|
+
inspect_swe-0.2.10.dist-info/entry_points.txt,sha256=OzpvUhd7M3T2Rog4MjwJAxIKeX5ljiR0mVYM9GefBKg,49
|
26
|
+
inspect_swe-0.2.10.dist-info/licenses/LICENSE,sha256=Hi3UDcbD6yCKZ1mcgt7pprzSG0rDEnSrbrm3XinyiDA,1070
|
27
|
+
inspect_swe-0.2.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|