flowent 0.0.10 → 0.0.11
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.
- package/backend/pyproject.toml +1 -1
- package/backend/src/flowent/__init__.py +6 -2
- package/backend/src/flowent/__pycache__/__init__.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/agent.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/context.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/llm.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/logging.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/main.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/patch.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/paths.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/sandbox.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/storage.cpython-313.pyc +0 -0
- package/backend/src/flowent/__pycache__/tools.cpython-313.pyc +0 -0
- package/backend/src/flowent/tools.py +15 -3
- package/backend/tests/__pycache__/test_agent_tools.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_health.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_llm_providers.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_logging.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_persistence.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/__pycache__/test_workspace_chat.cpython-313-pytest-9.0.3.pyc +0 -0
- package/backend/tests/test_agent_tools.py +28 -0
- package/backend/uv.lock +1 -1
- package/package.json +1 -1
- package/backend/src/flowent/__pycache__/cli.cpython-313.pyc +0 -0
package/backend/pyproject.toml
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -261,9 +261,7 @@ def apply_patch_tool(arguments: dict[str, object], context: ToolContext) -> Tool
|
|
|
261
261
|
input_text=patch,
|
|
262
262
|
)
|
|
263
263
|
if result.exit_code != 0:
|
|
264
|
-
raise SandboxError(
|
|
265
|
-
result.stderr or result.stdout or "Patch could not be applied."
|
|
266
|
-
)
|
|
264
|
+
raise SandboxError(tool_failure_content(result))
|
|
267
265
|
return ToolResult(
|
|
268
266
|
content=result.stdout,
|
|
269
267
|
data={"files": [str(path) for path in paths]},
|
|
@@ -271,6 +269,20 @@ def apply_patch_tool(arguments: dict[str, object], context: ToolContext) -> Tool
|
|
|
271
269
|
)
|
|
272
270
|
|
|
273
271
|
|
|
272
|
+
def tool_failure_content(result: object) -> str:
|
|
273
|
+
stdout = str(getattr(result, "stdout", "") or "").strip()
|
|
274
|
+
stderr = str(getattr(result, "stderr", "") or "").strip()
|
|
275
|
+
if stdout:
|
|
276
|
+
try:
|
|
277
|
+
payload = json.loads(stdout)
|
|
278
|
+
except json.JSONDecodeError:
|
|
279
|
+
payload = None
|
|
280
|
+
if isinstance(payload, dict) and isinstance(payload.get("error"), str):
|
|
281
|
+
return payload["error"]
|
|
282
|
+
parts = [part for part in [stderr, stdout] if part]
|
|
283
|
+
return "\n".join(parts) or "Tool failed."
|
|
284
|
+
|
|
285
|
+
|
|
274
286
|
def shell_command(arguments: dict[str, object], context: ToolContext) -> ToolResult:
|
|
275
287
|
command = str(arguments["command"])
|
|
276
288
|
timeout_seconds = integer_argument(arguments, "timeout_seconds", 30)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -296,6 +296,34 @@ def test_apply_patch_uses_internal_subcommand(tmp_path, monkeypatch) -> None:
|
|
|
296
296
|
assert calls[0][1:4] == ["-m", "flowent.cli", "apply-patch"]
|
|
297
297
|
|
|
298
298
|
|
|
299
|
+
def test_apply_patch_reports_patch_error_when_stderr_has_warning(
|
|
300
|
+
tmp_path, monkeypatch
|
|
301
|
+
) -> None:
|
|
302
|
+
def fake_run(self, command, **kwargs):
|
|
303
|
+
from flowent.sandbox import CommandResult
|
|
304
|
+
|
|
305
|
+
return CommandResult(
|
|
306
|
+
command=" ".join(command),
|
|
307
|
+
exit_code=1,
|
|
308
|
+
stderr="RuntimeWarning: flowent.cli was already imported\n",
|
|
309
|
+
stdout='{"error": "Patch context was not found."}\n',
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
monkeypatch.setattr(SandboxRunner, "run", fake_run)
|
|
313
|
+
patch = """*** Begin Patch
|
|
314
|
+
*** Update File: notes.txt
|
|
315
|
+
@@
|
|
316
|
+
-missing
|
|
317
|
+
+ready
|
|
318
|
+
*** End Patch
|
|
319
|
+
"""
|
|
320
|
+
|
|
321
|
+
result = run_tool("apply_patch", {"patch": patch}, ToolContext(cwd=tmp_path))
|
|
322
|
+
|
|
323
|
+
assert not result.ok
|
|
324
|
+
assert result.content == "Patch context was not found."
|
|
325
|
+
|
|
326
|
+
|
|
299
327
|
def test_web_search_result_enters_tool_output(tmp_path) -> None:
|
|
300
328
|
def fake_search(query: str):
|
|
301
329
|
return [{"title": "Result", "url": "https://example.test", "snippet": query}]
|
package/backend/uv.lock
CHANGED
package/package.json
CHANGED
|
Binary file
|