inspect-swe 0.2.3__tar.gz → 0.2.6__tar.gz

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.
Files changed (28) hide show
  1. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/PKG-INFO +4 -2
  2. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/pyproject.toml +11 -2
  3. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/__init__.py +7 -2
  4. inspect_swe-0.2.6/src/inspect_swe/_claude_code/claude_code.py +207 -0
  5. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_claude_code/install/download.py +0 -17
  6. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_claude_code/install/install.py +2 -0
  7. inspect_swe-0.2.6/src/inspect_swe/_tools/download.py +27 -0
  8. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/_async.py +10 -1
  9. inspect_swe-0.2.6/src/inspect_swe/_util/_yaml.py +21 -0
  10. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/sandbox.py +2 -4
  11. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_version.py +2 -2
  12. inspect_swe-0.2.6/src/inspect_swe/py.typed +0 -0
  13. inspect_swe-0.2.3/src/inspect_swe/_claude_code/claude_code.py +0 -87
  14. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/.gitignore +0 -0
  15. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/LICENSE +0 -0
  16. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/README.md +0 -0
  17. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_claude_code/__init__.py +0 -0
  18. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_claude_code/install/__init__.py +0 -0
  19. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_claude_code/install/cache.py +0 -0
  20. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_registry.py +0 -0
  21. {inspect_swe-0.2.3/src/inspect_swe/_util → inspect_swe-0.2.6/src/inspect_swe/_tools}/__init__.py +0 -0
  22. /inspect_swe-0.2.3/src/inspect_swe/py.typed → /inspect_swe-0.2.6/src/inspect_swe/_util/__init__.py +0 -0
  23. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/appdirs.py +0 -0
  24. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/checksum.py +0 -0
  25. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/constants.py +0 -0
  26. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/download.py +0 -0
  27. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/platform.py +0 -0
  28. {inspect_swe-0.2.3 → inspect_swe-0.2.6}/src/inspect_swe/_util/trace.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inspect_swe
3
- Version: 0.2.3
3
+ Version: 0.2.6
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,10 +10,11 @@ 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.125
13
+ Requires-Dist: inspect-ai>=0.3.126
14
14
  Requires-Dist: nest-asyncio
15
15
  Requires-Dist: platformdirs
16
16
  Requires-Dist: pydantic>=2.11.4
17
+ Requires-Dist: pyyaml
17
18
  Requires-Dist: sniffio
18
19
  Requires-Dist: typing-extensions>=4.9.0
19
20
  Provides-Extra: dev
@@ -23,6 +24,7 @@ Requires-Dist: openai; extra == 'dev'
23
24
  Requires-Dist: pytest; extra == 'dev'
24
25
  Requires-Dist: pytest-dotenv; extra == 'dev'
25
26
  Requires-Dist: ruff; extra == 'dev'
27
+ Requires-Dist: types-pyyaml; extra == 'dev'
26
28
  Provides-Extra: doc
27
29
  Requires-Dist: quarto-cli==1.7.31; extra == 'doc'
28
30
  Description-Content-Type: text/markdown
@@ -12,10 +12,11 @@ requires-python = ">=3.10"
12
12
  license = { text = "MIT License" }
13
13
  dependencies = [
14
14
  "httpx",
15
- "inspect_ai>=0.3.125",
15
+ "inspect_ai>=0.3.126",
16
16
  "nest_asyncio",
17
17
  "platformdirs",
18
18
  "pydantic>=2.11.4",
19
+ "pyyaml",
19
20
  "sniffio",
20
21
  "typing_extensions>=4.9.0",
21
22
  ]
@@ -30,7 +31,15 @@ inspect_swe = "inspect_swe._registry"
30
31
 
31
32
 
32
33
  [project.optional-dependencies]
33
- dev = ["ruff", "mypy", "pytest", "anthropic", "openai", "pytest-dotenv"]
34
+ dev = [
35
+ "ruff",
36
+ "mypy",
37
+ "pytest",
38
+ "anthropic",
39
+ "openai",
40
+ "pytest-dotenv",
41
+ "types-PyYAML",
42
+ ]
34
43
  doc = ["quarto-cli==1.7.31"]
35
44
 
36
45
  [tool.hatch.build]
@@ -1,5 +1,5 @@
1
1
  from ._claude_code.claude_code import claude_code
2
- from ._claude_code.install.download import download_claude_code
2
+ from ._tools.download import download_agent_binary
3
3
  from ._util.sandbox import SandboxPlatform
4
4
 
5
5
  try:
@@ -8,4 +8,9 @@ except ImportError:
8
8
  __version__ = "unknown"
9
9
 
10
10
 
11
- __all__ = ["claude_code", "download_claude_code", "SandboxPlatform", "__version__"]
11
+ __all__ = [
12
+ "claude_code",
13
+ "download_agent_binary",
14
+ "SandboxPlatform",
15
+ "__version__",
16
+ ]
@@ -0,0 +1,207 @@
1
+ import uuid
2
+ from textwrap import dedent
3
+ from typing import Any, Literal, Sequence
4
+
5
+ from inspect_ai.agent import (
6
+ Agent,
7
+ AgentAttempts,
8
+ AgentState,
9
+ agent,
10
+ agent_with,
11
+ sandbox_agent_bridge,
12
+ )
13
+ from inspect_ai.model import ChatMessageSystem, ChatMessageUser
14
+ from inspect_ai.scorer import score
15
+ from inspect_ai.tool import MCPServerConfig
16
+ from inspect_ai.util import sandbox as sandbox_env
17
+ from pydantic_core import to_json
18
+
19
+ from .._util._async import is_callable_coroutine
20
+ from .install.install import ensure_claude_code_installed
21
+
22
+
23
+ @agent
24
+ def claude_code(
25
+ name: str = "Claude Code",
26
+ description: str = dedent("""
27
+ Autonomous coding agent capable of writing, testing, debugging,
28
+ and iterating on code across multiple languages.
29
+ """),
30
+ system_prompt: str | None = None,
31
+ mcp_servers: Sequence[MCPServerConfig] | None = None,
32
+ attempts: int | AgentAttempts = 1,
33
+ model: str | None = None,
34
+ small_model: str | None = None,
35
+ env: dict[str, str] | None = None,
36
+ version: Literal["auto", "sandbox", "stable", "latest"] | str = "auto",
37
+ user: str | None = None,
38
+ sandbox: str | None = None,
39
+ ) -> Agent:
40
+ """Claude Code agent.
41
+
42
+ Agent that uses [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) running in a sandbox.
43
+
44
+ The agent can either use a version of Claude Code installed in the sandbox, or can download a version and install it in the sandbox (see docs on `version` option below for details).
45
+
46
+ Use the `attempts` option to enable additional submissions if the initial
47
+ submission(s) are incorrect (by default, no additional attempts are permitted).
48
+
49
+ Args:
50
+ name: Agent name (used in multi-agent systems with `as_tool()` and `handoff()`)
51
+ description: Agent description (used in multi-agent systems with `as_tool()` and `handoff()`)
52
+ system_prompt: Additional system prompt to append to default system prompt.
53
+ mcp_servers: MCP servers to make available to the agent.
54
+ attempts: Configure agent to make multiple attempts.
55
+ model: Model name to use for Opus and Sonnet calls (defaults to main model for task).
56
+ small_model: Model to use for Haiku calls (defaults to main model for task).
57
+ env: Environment variables to set for claude code.
58
+ version: Version of claude code to use. One of:
59
+ - "auto": Use any available version of claude code in the sandbox, otherwise download the current stable version.
60
+ - "sandbox": Use the version of claude code in the sandbox (raises `RuntimeError` if claude is not available in the sandbox)
61
+ - "stable": Download and use the current stable version of claude code.
62
+ - "latest": Download and use the very latest version of claude code.
63
+ - "x.x.x": Download and use a specific version of claude code.
64
+ user: User to execute claude code with.
65
+ sandbox: Optional sandbox environment name.
66
+ """
67
+ # resolve models
68
+ model = f"inspect/{model}" if model is not None else "inspect"
69
+ small_model = f"inspect/{small_model}" if small_model is not None else "inspect"
70
+
71
+ # resolve attempts
72
+ attempts = AgentAttempts(attempts) if isinstance(attempts, int) else attempts
73
+
74
+ async def execute(state: AgentState) -> AgentState:
75
+ async with sandbox_agent_bridge(state) as bridge:
76
+ # ensure claude is installed and get binary location
77
+ claude_binary = await ensure_claude_code_installed(
78
+ version, user, sandbox_env(sandbox)
79
+ )
80
+
81
+ # allocate session_id
82
+ session_id = str(uuid.uuid4())
83
+
84
+ # base options
85
+ cmd = [
86
+ "--print", # run without interactions
87
+ "--dangerously-skip-permissions",
88
+ "--model",
89
+ model,
90
+ ]
91
+
92
+ # system prompt
93
+ system_messages = [
94
+ m.text for m in state.messages if isinstance(m, ChatMessageSystem)
95
+ ]
96
+ if system_prompt is not None:
97
+ system_messages.append(system_prompt)
98
+ if system_messages:
99
+ cmd.extend(["--append-system-prompt", "\n\n".join(system_messages)])
100
+
101
+ # mcp servers
102
+ if mcp_servers:
103
+ cmd.extend(mcp_server_args(mcp_servers))
104
+
105
+ # user prompt
106
+ prompt = "\n\n".join(
107
+ [m.text for m in state.messages if isinstance(m, ChatMessageUser)]
108
+ )
109
+
110
+ # resolve sandbox
111
+ sbox = sandbox_env(sandbox)
112
+
113
+ # execute the agent
114
+ agent_prompt = prompt
115
+ attempt_count = 0
116
+ while True:
117
+ # either starting a new session or resuming one
118
+ id_param = "--session-id" if attempt_count == 0 else "--resume"
119
+ agent_cmd = (
120
+ [claude_binary, id_param, session_id] + cmd + ["--", agent_prompt]
121
+ )
122
+
123
+ # run agent
124
+ result = await sbox.exec(
125
+ cmd=agent_cmd,
126
+ env={
127
+ "ANTHROPIC_BASE_URL": f"http://localhost:{bridge.port}",
128
+ "ANTHROPIC_API_KEY": "sk-ant-api03-DOq5tyLPrk9M4hPE",
129
+ "ANTHROPIC_MODEL": model,
130
+ "ANTHROPIC_DEFAULT_OPUS_MODEL": model,
131
+ "ANTHROPIC_DEFAULT_SONNET_MODEL": model,
132
+ "CLAUDE_CODE_SUBAGENT_MODEL": model,
133
+ "ANTHROPIC_DEFAULT_HAIKU_MODEL": small_model,
134
+ "ANTHROPIC_SMALL_FAST_MODEL": small_model,
135
+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
136
+ "IS_SANDBOX": "1",
137
+ }
138
+ | (env or {}),
139
+ user=user,
140
+ )
141
+
142
+ # raise for error
143
+ if not result.success:
144
+ f"Error executing claude code agent: {result.stdout}\n{result.stderr}"
145
+
146
+ # exit if we are at max_attempts
147
+ attempt_count += 1
148
+ if attempt_count >= attempts.attempts:
149
+ break
150
+
151
+ # score this attempt
152
+ answer_scores = await score(state)
153
+
154
+ # break if we score 'correct'
155
+ if attempts.score_value(answer_scores[0].value) == 1.0:
156
+ break
157
+
158
+ # otherwise update prompt with incorrect message and continue
159
+ else:
160
+ if callable(attempts.incorrect_message):
161
+ if not is_callable_coroutine(attempts.incorrect_message):
162
+ raise ValueError(
163
+ "The incorrect_message function must be async."
164
+ )
165
+ agent_prompt = await attempts.incorrect_message(
166
+ state, answer_scores
167
+ )
168
+ else:
169
+ agent_prompt = attempts.incorrect_message
170
+
171
+ return bridge.state
172
+
173
+ # return agent with specified name and descritpion
174
+ return agent_with(execute, name=name, description=description)
175
+
176
+
177
+ def mcp_server_args(mcp_servers: Sequence[MCPServerConfig]) -> list[str]:
178
+ # build servers and allowed tools
179
+ mcp_servers_json: dict[str, dict[str, Any]] = {}
180
+ allowed_tools: list[str] = []
181
+ for mcp_server in mcp_servers:
182
+ mcp_servers_json[mcp_server.name] = mcp_server.model_dump(
183
+ exclude={"name", "tools"}, exclude_none=True
184
+ )
185
+ if mcp_server.tools == "all":
186
+ allowed_tools.append(f"mcp__{mcp_server.name}_*")
187
+ elif isinstance(mcp_server.tools, list):
188
+ allowed_tools.extend(
189
+ [f"mcp__{mcp_server.name}__{tool}" for tool in mcp_server.tools]
190
+ )
191
+ else:
192
+ raise ValueError(
193
+ f"Unexpected value for mcp server tools: {mcp_server.tools}"
194
+ )
195
+
196
+ # map to cli args
197
+ cmds: list[str] = []
198
+ if len(mcp_servers_json) > 0:
199
+ cmds.append("--mcp-config")
200
+ cmds.append(
201
+ to_json({"mcpServers": mcp_servers_json}, exclude_none=True).decode()
202
+ )
203
+ if len(allowed_tools):
204
+ cmds.append("--allowed-tools")
205
+ cmds.append(",".join(allowed_tools))
206
+
207
+ return cmds
@@ -3,7 +3,6 @@ from typing import Literal
3
3
 
4
4
  from pydantic import BaseModel
5
5
 
6
- from ..._util._async import run_coroutine
7
6
  from ..._util.checksum import verify_checksum
8
7
  from ..._util.download import download_file, download_text_file
9
8
  from ..._util.sandbox import SandboxPlatform
@@ -14,22 +13,6 @@ from .cache import (
14
13
  )
15
14
 
16
15
 
17
- def download_claude_code(
18
- version: Literal["stable", "latest"] | str, platform: SandboxPlatform
19
- ) -> None:
20
- """Download Claude Code.
21
-
22
- Download a version of Claude Code. This version will be added to the cache of downloaded versions (which retains the 5 most recently downloaded versions).
23
-
24
- Use this if you need to ensure that a specific version of Claude Code is downloaded in advance (e.g. if you are going to run your evaluations offline). After downloading, explicit requests for the downloaded version (e.g. `claude_code(version="1.0.98")`) will not require network access.
25
-
26
- Args:
27
- version: Version to download ("stable", "latest", or an explicit version number).
28
- platform: Target platform ("linux-x64", "linux-arm64", "linux-x64-musl", or "linux-arm64-musl")
29
- """
30
- run_coroutine(download_claude_code_async(version, platform))
31
-
32
-
33
16
  async def download_claude_code_async(
34
17
  version: Literal["stable", "latest"] | str, platform: SandboxPlatform
35
18
  ) -> bytes:
@@ -45,6 +45,8 @@ async def ensure_claude_code_installed(
45
45
  )
46
46
  if claude_binary_bytes is not None:
47
47
  trace(f"Used claude code binary from cache: {version} ({platform})")
48
+ else:
49
+ claude_binary_bytes = None
48
50
 
49
51
  # download the binary
50
52
  if claude_binary_bytes is None:
@@ -0,0 +1,27 @@
1
+ from typing import Literal
2
+
3
+ from .._claude_code.install.download import download_claude_code_async
4
+ from .._util._async import run_coroutine
5
+ from .._util.sandbox import SandboxPlatform
6
+
7
+
8
+ def download_agent_binary(
9
+ binary: Literal["claude_code"],
10
+ version: Literal["stable", "latest"] | str,
11
+ platform: SandboxPlatform,
12
+ ) -> None:
13
+ """Download agent binary.
14
+
15
+ Download an agent binary. This version will be added to the cache of downloaded versions (which retains the 5 most recently downloaded versions).
16
+
17
+ Use this if you need to ensure that a specific version of an agent binary is downloaded in advance (e.g. if you are going to run your evaluations offline). After downloading, explicit requests for the downloaded version (e.g. `claude_code(version="1.0.98")`) will not require network access.
18
+
19
+ Args:
20
+ binary: Type of binary to download (currently only "claude_code")
21
+ version: Version to download ("stable", "latest", or an explicit version number).
22
+ platform: Target platform ("linux-x64", "linux-arm64", "linux-x64-musl", or "linux-arm64-musl")
23
+ """
24
+ if binary == "claude_code":
25
+ run_coroutine(download_claude_code_async(version, platform))
26
+ else:
27
+ raise ValueError(f"Unsuported agent binary type: {binary}")
@@ -1,5 +1,6 @@
1
1
  import asyncio
2
- from typing import Coroutine, Literal, TypeVar, cast
2
+ import inspect
3
+ from typing import Any, Coroutine, Literal, TypeVar, cast
3
4
 
4
5
  import nest_asyncio # type: ignore
5
6
  import sniffio
@@ -9,6 +10,14 @@ from .platform import running_in_notebook
9
10
  T = TypeVar("T")
10
11
 
11
12
 
13
+ def is_callable_coroutine(func_or_cls: Any) -> bool:
14
+ if inspect.iscoroutinefunction(func_or_cls):
15
+ return True
16
+ elif callable(func_or_cls):
17
+ return inspect.iscoroutinefunction(func_or_cls.__call__)
18
+ return False
19
+
20
+
12
21
  def run_coroutine(coroutine: Coroutine[None, None, T]) -> T:
13
22
  if current_async_backend() == "trio":
14
23
  raise RuntimeError("run_coroutine cannot be used with trio")
@@ -0,0 +1,21 @@
1
+ import re
2
+
3
+ import yaml
4
+
5
+
6
+ def read_front_matter_name(content: str) -> str | None:
7
+ # front-matter
8
+ frontmatter_match = re.match(r"^\s*---\s*\n(.*?)\n---", content, re.DOTALL)
9
+ if not frontmatter_match:
10
+ return None
11
+ frontmatter = frontmatter_match.group(1)
12
+
13
+ try:
14
+ # Parse as YAML
15
+ data = yaml.safe_load(frontmatter)
16
+ if "name" in data:
17
+ return str(data.get("name"))
18
+ else:
19
+ return None
20
+ except yaml.YAMLError:
21
+ return None
@@ -45,7 +45,7 @@ async def detect_sandbox_platform(sandbox: SandboxEnvironment) -> SandboxPlatfor
45
45
 
46
46
 
47
47
  def bash_command(cmd: str) -> list[str]:
48
- return ["bash", "--login", "-c", cmd]
48
+ return ["bash", "-c", cmd]
49
49
 
50
50
 
51
51
  async def sandbox_exec(
@@ -53,7 +53,5 @@ async def sandbox_exec(
53
53
  ) -> str:
54
54
  result = await sandbox.exec(bash_command(cmd), user=user)
55
55
  if not result.success:
56
- raise RuntimeError(
57
- f"Error executing sandbox command {','.join(cmd)}: {result.stderr}"
58
- )
56
+ raise RuntimeError(f"Error executing sandbox command {cmd}: {result.stderr}")
59
57
  return result.stdout.strip()
@@ -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.3'
32
- __version_tuple__ = version_tuple = (0, 2, 3)
31
+ __version__ = version = '0.2.6'
32
+ __version_tuple__ = version_tuple = (0, 2, 6)
33
33
 
34
34
  __commit_id__ = commit_id = None
File without changes
@@ -1,87 +0,0 @@
1
- from typing import Literal
2
-
3
- from inspect_ai.agent import (
4
- Agent,
5
- AgentState,
6
- agent,
7
- sandbox_agent_bridge,
8
- )
9
- from inspect_ai.model import ChatMessageSystem, ChatMessageUser
10
- from inspect_ai.util import sandbox as sandbox_env
11
-
12
- from inspect_swe._claude_code.install.install import ensure_claude_code_installed
13
-
14
-
15
- @agent
16
- def claude_code(
17
- version: Literal["auto", "sandbox", "stable", "latest"] | str = "auto",
18
- user: str | None = None,
19
- sandbox: str | None = None,
20
- ) -> Agent:
21
- """Claude Code agent.
22
-
23
- Agent that uses [Claude Code](https://docs.anthropic.com/en/docs/claude-code/overview) running in a sandbox.
24
-
25
- The agent can either use a version of Claude Code installed in the sandbox, or can download a version and install it in the sandbox (see docs on `version` option below for details).
26
-
27
- Args:
28
- version: Version of claude code to use. One of:
29
- - "auto": Use any available version of claude code in the sandbox, otherwise download the current stable version.
30
- - "sandbox": Use the version of claude code in the sandbox (raises `RuntimeError` if claude is not available in the sandbox)
31
- - "stable": Download and use the current stable version of claude code.
32
- - "latest": Download and use the very latest version of claude code.
33
- - "x.x.x": Download and use a specific version of claude code.
34
- user: User to execute claude code with.
35
- sandbox: Optional sandbox environment name.
36
- """
37
-
38
- async def execute(state: AgentState) -> AgentState:
39
- async with sandbox_agent_bridge(state) as bridge:
40
- # ensure claude is installed and get binary location
41
- claude_binary = await ensure_claude_code_installed(
42
- version, user, sandbox_env(sandbox)
43
- )
44
-
45
- # base options
46
- cmd = [
47
- claude_binary,
48
- "--print", # run without interactions
49
- "--dangerously-skip-permissions",
50
- "--model", # use current inspect model
51
- "inspect",
52
- ]
53
-
54
- # system message
55
- system_message = "\n\n".join(
56
- [m.text for m in state.messages if isinstance(m, ChatMessageSystem)]
57
- )
58
- if system_message:
59
- cmd.extend(["--append-system-prompt", system_message])
60
-
61
- # user prompt
62
- prompt = "\n\n".join(
63
- [m.text for m in state.messages if isinstance(m, ChatMessageUser)]
64
- )
65
- cmd.append(prompt)
66
-
67
- # execute the agent
68
- result = await sandbox_env(sandbox).exec(
69
- cmd=cmd,
70
- env={
71
- "ANTHROPIC_BASE_URL": f"http://localhost:{bridge.port}",
72
- "ANTHROPIC_API_KEY": "sk-ant-api03-DOq5tyLPrk9M4hPE",
73
- "ANTHROPIC_SMALL_FAST_MODEL": "inspect",
74
- "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
75
- "IS_SANDBOX": "1",
76
- },
77
- user=user,
78
- )
79
-
80
- if result.success:
81
- return bridge.state
82
- else:
83
- raise RuntimeError(
84
- f"Error executing claude code agent: {result.stdout}\n{result.stderr}"
85
- )
86
-
87
- return execute
File without changes
File without changes
File without changes