Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Commit ·
38ab4b6
1
Parent(s): 1384bcb
feat: inject OAuth token as HF_TOKEN secret into sandbox Space
Browse files
agent/tools/sandbox_tool.py
CHANGED
|
@@ -66,6 +66,9 @@ async def _ensure_sandbox(
|
|
| 66 |
sb = await asyncio.to_thread(Sandbox.create, **kwargs)
|
| 67 |
session.sandbox = sb
|
| 68 |
|
|
|
|
|
|
|
|
|
|
| 69 |
await session.send_event(
|
| 70 |
Event(
|
| 71 |
event_type="tool_log",
|
|
|
|
| 66 |
sb = await asyncio.to_thread(Sandbox.create, **kwargs)
|
| 67 |
session.sandbox = sb
|
| 68 |
|
| 69 |
+
# Inject the OAuth token into the sandbox so Hub operations work inside it
|
| 70 |
+
await asyncio.to_thread(api.add_space_secret, sb.space_id, "HF_TOKEN", token)
|
| 71 |
+
|
| 72 |
await session.send_event(
|
| 73 |
Event(
|
| 74 |
event_type="tool_log",
|