From 57bb2a29e11b7b181a95193c7c2d7ccc1c0bd97a Mon Sep 17 00:00:00 2001 From: Antigravity Date: Thu, 21 May 2026 21:19:24 -0400 Subject: [PATCH] fix: resolve path for index.html in dashboard api --- agents/bernard/bernard/dashboard/api.py | 8 +++++++- agents/k8s/bernard-deployment.yaml | 12 ++++++------ agents/trigger_bernard.py | 7 +++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/agents/bernard/bernard/dashboard/api.py b/agents/bernard/bernard/dashboard/api.py index abcae48..6bff04f 100644 --- a/agents/bernard/bernard/dashboard/api.py +++ b/agents/bernard/bernard/dashboard/api.py @@ -116,4 +116,10 @@ async def health(): @app.get("/{full_path:path}") async def serve_spa(full_path: str): - return FileResponse("/app/static/index.html") + static_dir = os.path.join(os.path.dirname(__file__), "static") + # If the user asks for a static file like JS/CSS, try to serve it directly + file_path = os.path.join(static_dir, full_path) + if os.path.isfile(file_path) and full_path: + return FileResponse(file_path) + # Otherwise return the SPA index.html + return FileResponse(os.path.join(static_dir, "index.html")) diff --git a/agents/k8s/bernard-deployment.yaml b/agents/k8s/bernard-deployment.yaml index 33442aa..a33afc0 100644 --- a/agents/k8s/bernard-deployment.yaml +++ b/agents/k8s/bernard-deployment.yaml @@ -72,8 +72,8 @@ spec: cpu: 100m memory: 256Mi limits: - cpu: 500m - memory: 512Mi + cpu: 1000m + memory: 1024Mi volumes: - name: workspace emptyDir: {} @@ -133,21 +133,21 @@ spec: httpGet: path: /health port: 8080 - initialDelaySeconds: 30 + initialDelaySeconds: 120 periodSeconds: 15 readinessProbe: httpGet: path: /health port: 8080 - initialDelaySeconds: 10 + initialDelaySeconds: 120 periodSeconds: 5 resources: requests: cpu: 50m memory: 128Mi limits: - cpu: 200m - memory: 256Mi + cpu: 1000m + memory: 1024Mi volumes: - name: workspace emptyDir: {} diff --git a/agents/trigger_bernard.py b/agents/trigger_bernard.py index 693711a..931aa94 100644 --- a/agents/trigger_bernard.py +++ b/agents/trigger_bernard.py @@ -2,13 +2,15 @@ from __future__ import annotations import asyncio +import os import sys from temporalio.client import Client async def trigger_pr_review(): - client = await Client.connect("localhost:7233", namespace="default") + address = os.environ.get("TEMPORAL_ADDRESS", "localhost:7233") + client = await Client.connect(address, namespace="default") handle = await client.start_workflow( "PRReviewWorkflow", id="bernard-pr-review-run-1", @@ -21,7 +23,8 @@ async def trigger_pr_review(): async def trigger_monitor(): - client = await Client.connect("localhost:7233", namespace="default") + address = os.environ.get("TEMPORAL_ADDRESS", "localhost:7233") + client = await Client.connect(address, namespace="default") handle = await client.start_workflow( "TemporalMonitorWorkflow", id="bernard-monitor-run-1",