From b10a0cf1f8a6706f49a27e60aef1a37c47c1a31e Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Wed, 10 Jun 2026 15:46:01 +0500 Subject: [PATCH 1/2] fix(daytona): avoid leaking internal hydrate temp path in type error **fix(daytona): report workspace root in hydrate_workspace type errors** ## Summary `hydrate_workspace()` currently raises `WorkspaceWriteTypeError` with the internal temporary tar path (`/tmp/sandbox-hydrate-...`) when the input payload is not bytes-like. That path is an implementation detail and not the user-facing target of the operation. This change reports the workspace root instead, which matches the actual hydration target and keeps error reporting aligned with the rest of the Daytona sandbox code. ## Why this change - Avoid exposing backend temp-file details in user-facing errors. - Make the error path correspond to the workspace being hydrated, not the internal staging archive. - Keep the failure mode consistent with other workspace archive errors in this module, which already report the workspace root on hydration failures. ## Scope This is intentionally narrow: - no functional behavior changes - no change to tar extraction logic - no change to upload or cleanup flow - only the `WorkspaceWriteTypeError` path is adjusted ## Validation - Confirmed the error now references the workspace root instead of `/tmp/sandbox-hydrate-...` - Kept the change isolated to the type-check branch so the runtime behavior remains unchanged elsewhere. :contentReference[oaicite:1]{index=1} --- src/agents/extensions/sandbox/daytona/sandbox.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/agents/extensions/sandbox/daytona/sandbox.py b/src/agents/extensions/sandbox/daytona/sandbox.py index 36bd195031..cc6cf11167 100644 --- a/src/agents/extensions/sandbox/daytona/sandbox.py +++ b/src/agents/extensions/sandbox/daytona/sandbox.py @@ -1133,7 +1133,10 @@ async def hydrate_workspace(self, data: io.IOBase) -> None: if isinstance(payload, str): payload = payload.encode("utf-8") if not isinstance(payload, bytes | bytearray): - raise WorkspaceWriteTypeError(path=Path(tar_path), actual_type=type(payload).__name__) + raise WorkspaceWriteTypeError( + path=root, + actual_type=type(payload).__name__ + ) try: validate_tar_bytes( From 842faf8f2ed3d04afa8f84115cf535a4c73427fe Mon Sep 17 00:00:00 2001 From: MUHAMMAD SALMAN HUSSAIN <160324527+mshsheikh@users.noreply.github.com> Date: Thu, 11 Jun 2026 19:16:21 +0500 Subject: [PATCH 2/2] Fix missing newline at end of sandbox.py