This commit is contained in:
2026-06-01 17:09:40 +03:00
parent 4c5da7e4d9
commit 40e364d9f6
5 changed files with 17 additions and 10 deletions

View File

@@ -150,11 +150,11 @@ def _update_run_status(db, run_id: str | None) -> None:
run.unknown_count = unknown_count
db.commit()
logger.info(
f"[_update_run_status] Run {run_id} completed: "
f"PASS={pass_count} WARN={warn_count} FAIL={fail_count} UNKNOWN={unknown_count}"
)
except Exception as e:
logger.error(f"[_update_run_status] Failed to finalize run {run_id}: {e}")
f"[_update_run_status] Run {run_id} completed: "
f"PASS={pass_count} WARN={warn_count} FAIL={fail_count} UNKNOWN={unknown_count}"
)
except Exception as e:
logger.error(f"[_update_run_status] Failed to finalize run {run_id}: {e}")
# #endregion _update_run_status

View File

@@ -208,7 +208,7 @@ class RecordResponse(BaseModel):
dataset_health: dict[str, Any] | None = None
chart_data_results: list[dict[str, Any]] = Field(default_factory=list)
tab_screenshots: list[dict[str, Any]] = Field(default_factory=list)
logs_sent_to_llm: list[dict[str, Any]] = Field(default_factory=list)
logs_sent_to_llm: list[str] = Field(default_factory=list)
token_usage: dict[str, Any] | None = None
timings: dict[str, Any] | None = None

View File

@@ -124,7 +124,7 @@ function shouldSuppressApiErrorToast(endpoint: string, error: ApiError): boolean
*/
export const getWsUrl = (taskId: string): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/logs/${taskId}`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');
@@ -140,7 +140,7 @@ export const getWsUrl = (taskId: string): string => {
*/
export const getTaskEventsWsUrl = (): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/task-events`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');
@@ -156,7 +156,7 @@ export const getTaskEventsWsUrl = (): string => {
*/
export const getMaintenanceEventsWsUrl = (): string => {
const protocol = typeof window !== 'undefined' && window.location.protocol === 'https:' ? 'wss:' : 'ws:';
const host = typeof window !== 'development' && typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
const host = typeof window !== 'undefined' ? window.location.host : 'localhost:8000';
let url = `${protocol}//${host}/ws/maintenance/events`;
if (typeof window !== 'undefined') {
const token = localStorage.getItem('auth_token');

View File

@@ -149,7 +149,7 @@
<div
class="bg-primary h-2.5 rounded-full transition-all duration-500"
style="width: {Math.min(progressPct, 100)}%"
/>
></div>
</div>
<!-- Stats grid -->
@@ -181,6 +181,7 @@
class:bg-destructive={uxState === 'failed'}
class:bg-gray-500={uxState === 'cancelled'}
onclick={handleClick}
onkeydown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleClick(); } }}
role="button"
tabindex="0"
>

6
run.sh
View File

@@ -203,6 +203,12 @@ start_backend() {
fi
if [ -f ".env" ]; then
uvicorn_env_args=(--env-file .env)
# Also export .env vars so Python's os.environ sees them before app.py imports.
# uvicorn --env-file only affects uvicorn's own config, not the application.
set -a
# shellcheck disable=SC1091
. .env
set +a
fi
# PYTHONUNBUFFERED=1 prevents stderr buffering when piped through sed.
# Without it, JSON logs from superset_tools_app get stuck in the buffer