aisolate-client 0.3.6__tar.gz → 0.3.7__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 (36) hide show
  1. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/PKG-INFO +2 -2
  2. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/README.md +1 -1
  3. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/pyproject.toml +1 -1
  4. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/integration/test_sandbox.py +95 -0
  5. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate_client.egg-info/PKG-INFO +2 -2
  6. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/setup.cfg +0 -0
  7. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/__init__.py +0 -0
  8. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/__init__.py +0 -0
  9. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/exception.py +0 -0
  10. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/gateway_client.py +0 -0
  11. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/models.py +0 -0
  12. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/remote_executer.py +0 -0
  13. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/sandbox.py +0 -0
  14. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/sandbox_manager.py +0 -0
  15. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/__init__.py +0 -0
  16. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/integration/__init__.py +0 -0
  17. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/integration/conftest.py +0 -0
  18. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/integration/test_gateway_client.py +0 -0
  19. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/test_gateway_client_demux.py +0 -0
  20. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/client/tests/test_sandbox_workspace_prefix.py +0 -0
  21. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/__init__.py +0 -0
  22. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/codec.py +0 -0
  23. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/errors.py +0 -0
  24. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/execution_protocol.py +0 -0
  25. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/models.py +0 -0
  26. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/output_window.py +0 -0
  27. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/__init__.py +0 -0
  28. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/fake_vm.py +0 -0
  29. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/fixtures.py +0 -0
  30. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/test_codec_channel.py +0 -0
  31. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/test_output_window.py +0 -0
  32. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate/common/tests/utils.py +0 -0
  33. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate_client.egg-info/SOURCES.txt +0 -0
  34. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate_client.egg-info/dependency_links.txt +0 -0
  35. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate_client.egg-info/requires.txt +0 -0
  36. {aisolate_client-0.3.6 → aisolate_client-0.3.7}/src/aisolate_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aisolate-client
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Client library for sandbox environments
5
5
  License: Apache-2.0
6
6
  Requires-Python: >=3.10
@@ -16,7 +16,7 @@ Client library for sandbox environments
16
16
  ## Local Installation
17
17
 
18
18
  ```bash
19
- pip install path/to/aisolate_client-0.3.6-py3-none-any.whl
19
+ pip install path/to/aisolate_client-0.3.7-py3-none-any.whl
20
20
  ```
21
21
 
22
22
  ## Usage
@@ -5,7 +5,7 @@ Client library for sandbox environments
5
5
  ## Local Installation
6
6
 
7
7
  ```bash
8
- pip install path/to/aisolate_client-0.3.6-py3-none-any.whl
8
+ pip install path/to/aisolate_client-0.3.7-py3-none-any.whl
9
9
  ```
10
10
 
11
11
  ## Usage
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "aisolate-client"
7
- version = "0.3.6"
7
+ version = "0.3.7"
8
8
  description = "Client library for sandbox environments"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -78,6 +78,101 @@ async def test_execution_with_error(sandbox_cls):
78
78
  assert "ZeroDivisionError: division by zero" in execution.traceback_str
79
79
 
80
80
 
81
+ @pytest.mark.asyncio
82
+ async def test_uncaught_network_exception_crosses_the_cell_top(sandbox_cls):
83
+ """A network failure nothing catches unwinds past the cell's last frame,
84
+ so the kernel publishes an error message — same as ZeroDivisionError
85
+ above. The kernel does not care about the exception's TYPE, only that it
86
+ escaped the cell."""
87
+ async with sandbox_cls(sandbox_id="sbx_net_uncaught") as sbx:
88
+ code = dedent(
89
+ """
90
+ raise ConnectionError(
91
+ "HTTPConnectionPool(host='api.invalid', port=8181): "
92
+ "Max retries exceeded"
93
+ )
94
+ """
95
+ )
96
+ execution = await sbx.arun_code(code)
97
+
98
+ assert execution.has_error
99
+ assert execution.error is not None
100
+ assert execution.error.error_name == "ConnectionError"
101
+ assert "Max retries exceeded" in execution.error.error_value
102
+
103
+
104
+ @pytest.mark.asyncio
105
+ async def test_caught_network_exception_never_reaches_the_cell_top(sandbox_cls):
106
+ """The SAME failure caught by ``except Exception`` inside the cell never
107
+ reaches the cell top: the cell ran to completion, so the kernel reports a
108
+ successful execution and the failure survives only as text on stdout.
109
+
110
+ The kernel's one sensor is the cell-top boundary — it cannot see what
111
+ code inside the cell absorbed. ``has_error`` (and every consumer of it,
112
+ including the executor's ``ok`` flag) therefore reports on escape, not on
113
+ whether anything inside the cell failed."""
114
+ async with sandbox_cls(sandbox_id="sbx_net_caught") as sbx:
115
+ code = dedent(
116
+ """
117
+ try:
118
+ raise ConnectionError(
119
+ "HTTPConnectionPool(host='api.invalid', port=8181): "
120
+ "Max retries exceeded"
121
+ )
122
+ except Exception as e:
123
+ print(str(e))
124
+ """
125
+ )
126
+ execution = await sbx.arun_code(code)
127
+
128
+ assert not execution.has_error
129
+ assert execution.error is None
130
+ assert "Max retries exceeded" in execution.stdout
131
+
132
+
133
+ @pytest.mark.asyncio
134
+ async def test_action_failure_escapes_a_generic_except(sandbox_cls):
135
+ """Regression pin for the ActionFailed seam: an exception escaping an
136
+ action's execute() re-raises as ActionFailed (BaseException), so the
137
+ agent-style ``except Exception`` above cannot absorb it — unlike the
138
+ bare ConnectionError in the previous test, the cell fails and the
139
+ kernel reports the error."""
140
+ async with sandbox_cls(sandbox_id="sbx_action_failed") as sbx:
141
+ code = dedent(
142
+ """
143
+ from aisolate.agent.tools.actions.base import CodeAction
144
+
145
+ class Failing(CodeAction):
146
+ name = "failing"
147
+ description = "raises from execute"
148
+ parameters = {"type": "object", "properties": {}, "required": []}
149
+ output_type = "string"
150
+ requirements = []
151
+
152
+ def execute(self):
153
+ raise ConnectionError(
154
+ "HTTPConnectionPool(host='api.invalid', port=8181): "
155
+ "Max retries exceeded"
156
+ )
157
+
158
+ action = Failing()
159
+ try:
160
+ action()
161
+ except Exception as e:
162
+ print("swallowed:", e)
163
+ """
164
+ )
165
+ execution = await sbx.arun_code(code)
166
+
167
+ assert execution.has_error
168
+ assert execution.error is not None
169
+ assert execution.error.error_name == "ActionFailed"
170
+ assert "failing failed" in execution.error.error_value
171
+ assert "Max retries exceeded" in execution.error.error_value
172
+ # The generic handler never ran — nothing was printed.
173
+ assert "swallowed" not in execution.stdout
174
+
175
+
81
176
  @pytest.mark.asyncio
82
177
  async def test_execution_generates_image(sandbox_cls):
83
178
  """Test execution that generates a plot and verify the image property."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aisolate-client
3
- Version: 0.3.6
3
+ Version: 0.3.7
4
4
  Summary: Client library for sandbox environments
5
5
  License: Apache-2.0
6
6
  Requires-Python: >=3.10
@@ -16,7 +16,7 @@ Client library for sandbox environments
16
16
  ## Local Installation
17
17
 
18
18
  ```bash
19
- pip install path/to/aisolate_client-0.3.6-py3-none-any.whl
19
+ pip install path/to/aisolate_client-0.3.7-py3-none-any.whl
20
20
  ```
21
21
 
22
22
  ## Usage