Fix artifact API - use correct parameter and field names

Correct the artifact implementation to match Unsandbox API:
- Request parameter: return_artifact (boolean, singular)
- Response field: artifacts (array, plural)
- Data field: content_base64 (not data/content)

Changes:
- Backend: Changed artifacts to return_artifact in request body
- Frontend: Use return_artifact in execute request
- Frontend: Look for artifacts array in response (not artifact singleton)
- Frontend: Decode content_base64 field (not data/content)
- Frontend: Use filename field (primary) over name
- Remove debug console.log statements
- Update CLAUDE.md with correct API contract

The API parameter is singular but response is plural - this is intentional
design by Unsandbox API. Request enables artifact collection, response
returns array of generated artifacts.
This commit is contained in:
russell@unturf.com 2026-01-20 09:07:25 -05:00
parent b53ee2168b
commit c6e6e81c3c
3 changed files with 31 additions and 34 deletions

2
app.py
View file

@ -1276,7 +1276,7 @@ def proxy_code_execute():
request_body = {
"language": language,
"code": code,
"return_artifacts": True,
"return_artifact": True,
}
# Use SDK's internal _make_request for full parameter support