fix: Use timestamp-based file extraction instead of /output directory

Replace the hardcoded /output directory approach with timestamp-based
file extraction (matching ClaudeCodeBlock's pattern). This removes the
need to create a special directory and captures any files created or
modified during execution in /home/user.

Also fixes a potential UnboundLocalError in sandbox_files.py where
data_uri could be referenced in the except block before assignment,
and moves base64/mimetypes to top-level imports.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nicholas Tindle
2026-02-11 15:46:57 -06:00
parent a2856c1863
commit 1026f437a9
3 changed files with 21 additions and 21 deletions

View File

@@ -215,7 +215,7 @@ The sandbox includes pip and npm pre-installed. Set timeout to limit execution t
| response | Text output (if any) of the main execution result | str |
| stdout_logs | Standard output logs from execution | str |
| stderr_logs | Standard error logs from execution | str |
| files | Files written to /output directory during execution. Each file has path, name, content, and workspace_ref (if stored). | List[SandboxFileOutput] |
| files | Files created or modified during execution. Each file has path, name, content, and workspace_ref (if stored). | List[SandboxFileOutput] |
### Possible use case
<!-- MANUAL: use_case -->