fix backend but vnc url is still broken

This commit is contained in:
Adam Cohen Hillel 2025-04-18 14:50:06 +01:00
parent d688e204b6
commit 76163f6cc3
3 changed files with 8 additions and 5 deletions

View File

@ -285,8 +285,8 @@ async def start_agent(thread_id: str, user_id: str = Depends(get_current_user_id
'sandbox': { 'sandbox': {
'id': sandbox_id, 'id': sandbox_id,
'pass': sandbox_pass, 'pass': sandbox_pass,
'vnc_preview': sandbox.get_preview_link(6080), 'vnc_preview': str(sandbox.get_preview_link(6080)),
'sandbox_url': sandbox.get_preview_link(8080) 'sandbox_url': str(sandbox.get_preview_link(8080))
} }
}).eq('project_id', project_id).execute() }).eq('project_id', project_id).execute()

View File

@ -56,10 +56,10 @@ app = FastAPI(lifespan=lifespan)
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["*"], allow_origins=["https://www.suna.so", "https://suna.so", "http://localhost:3000"],
allow_credentials=True, allow_credentials=True,
allow_methods=["*"], allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"],
allow_headers=["*"], allow_headers=["Content-Type", "Authorization"],
) )
# Include the agent router with a prefix # Include the agent router with a prefix

View File

@ -454,6 +454,7 @@ export const startAgent = async (threadId: string): Promise<{ agent_run_id: stri
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Authorization': `Bearer ${session.access_token}`, 'Authorization': `Bearer ${session.access_token}`,
}, },
credentials: 'include',
}); });
if (!response.ok) { if (!response.ok) {
@ -519,6 +520,7 @@ export const getAgentStatus = async (agentRunId: string): Promise<AgentRun> => {
headers: { headers: {
'Authorization': `Bearer ${session.access_token}`, 'Authorization': `Bearer ${session.access_token}`,
}, },
credentials: 'include',
}); });
if (!response.ok) { if (!response.ok) {
@ -562,6 +564,7 @@ export const getAgentRuns = async (threadId: string): Promise<AgentRun[]> => {
headers: { headers: {
'Authorization': `Bearer ${session.access_token}`, 'Authorization': `Bearer ${session.access_token}`,
}, },
credentials: 'include',
}); });
if (!response.ok) { if (!response.ok) {