From 2835ac50a6149c011b8f39ae82e478d9ad73abf7 Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Sun, 25 May 2025 09:33:22 +0000 Subject: [PATCH 1/4] chore(config): add mise.toml for tool version specifications --- mise.toml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 mise.toml diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..32952db2 --- /dev/null +++ b/mise.toml @@ -0,0 +1,4 @@ +# https://mise.jdx.dev/ +[tools] +node = "20" +python = "3.11.10" From 39cd63ee67dc02cc7396bd11fd30cdc6d72fc702 Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Sun, 25 May 2025 09:42:31 +0000 Subject: [PATCH 2/4] fix(api): update allowed origins for CORS configuration in staging environment --- backend/api.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/api.py b/backend/api.py index 48b1b922..4fb4070a 100644 --- a/backend/api.py +++ b/backend/api.py @@ -105,15 +105,12 @@ async def log_requests_middleware(request: Request, call_next): raise # Define allowed origins based on environment -allowed_origins = ["https://www.suna.so", "https://suna.so", "https://staging.suna.so", "http://localhost:3000"] +allowed_origins = ["https://www.suna.so", "https://suna.so", "http://localhost:3000"] # Add staging-specific origins if config.ENV_MODE == EnvMode.STAGING: - allowed_origins.append("http://localhost:3000") - -# Add local-specific origins -if config.ENV_MODE == EnvMode.LOCAL: - allowed_origins.append("http://localhost:3000") + allowed_origins.append("https://suna-*-prjcts.vercel.app") + allowed_origins.append("https://staging.suna.so") app.add_middleware( CORSMiddleware, From 9c03856d920397edf10eef23a88671929f3762ce Mon Sep 17 00:00:00 2001 From: sharath <29162020+tnfssc@users.noreply.github.com> Date: Sun, 25 May 2025 10:31:38 +0000 Subject: [PATCH 3/4] chore(docker): add env_file to services and update CORS middleware for staging --- backend/api.py | 4 +++- docker-compose.yaml | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/api.py b/backend/api.py index 4fb4070a..e15a377f 100644 --- a/backend/api.py +++ b/backend/api.py @@ -106,15 +106,17 @@ async def log_requests_middleware(request: Request, call_next): # Define allowed origins based on environment allowed_origins = ["https://www.suna.so", "https://suna.so", "http://localhost:3000"] +allow_origin_regex = None # Add staging-specific origins if config.ENV_MODE == EnvMode.STAGING: - allowed_origins.append("https://suna-*-prjcts.vercel.app") allowed_origins.append("https://staging.suna.so") + allow_origin_regex = r"https://suna-.*-prjcts\.vercel\.app" app.add_middleware( CORSMiddleware, allow_origins=allowed_origins, + allow_origin_regex=allow_origin_regex, allow_credentials=True, allow_methods=["GET", "POST", "PUT", "DELETE", "OPTIONS"], allow_headers=["Content-Type", "Authorization"], diff --git a/docker-compose.yaml b/docker-compose.yaml index 1ce7d844..8078f586 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -36,8 +36,9 @@ services: - "8000:8000" volumes: - ./backend/.env:/app/.env:ro + env_file: + - ./backend/.env environment: - - ENV_MODE=local - REDIS_HOST=redis - REDIS_PORT=6379 - REDIS_PASSWORD= @@ -59,8 +60,9 @@ services: command: python -m dramatiq run_agent_background volumes: - ./backend/.env:/app/.env:ro + env_file: + - ./backend/.env environment: - - ENV_MODE=local - REDIS_HOST=redis - REDIS_PORT=6379 - REDIS_PASSWORD= From 1027d9ebf95bf5b79ddd79277079fe268a80ac76 Mon Sep 17 00:00:00 2001 From: Soumyadas15 Date: Sun, 25 May 2025 11:19:55 +0530 Subject: [PATCH 4/4] chore(dev): upgrade dialog hotfix --- frontend/src/hooks/react-query/dashboard/use-initiate-agent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/hooks/react-query/dashboard/use-initiate-agent.ts b/frontend/src/hooks/react-query/dashboard/use-initiate-agent.ts index 128e4911..7885bd64 100644 --- a/frontend/src/hooks/react-query/dashboard/use-initiate-agent.ts +++ b/frontend/src/hooks/react-query/dashboard/use-initiate-agent.ts @@ -50,7 +50,7 @@ export const useInitiateAgentWithInvalidation = () => { if (errorMessage.toLowerCase().includes("payment required")) { console.log('Opening payment required modal'); onOpen("paymentRequiredDialog"); - return; // Don't show other error toasts + return; } } }