From 6e978b9de909960ad55a88de4eff323385bca27b Mon Sep 17 00:00:00 2001 From: Francis Secada Date: Mon, 2 Feb 2026 23:09:05 -0500 Subject: [PATCH] fix: resolve remaining pydantic-ai 0.4.x breakages and startup errors - result_type -> output_type on Agent (core.py) - result_validator -> output_validator decorator (tools.py) - BASE_DIR was operating on the string literal "__name__" instead of __file__; all paths were relative to CWD and only worked in Docker because the entrypoint cd's into src/ first (consts.py) - url_for('static', filename=...) -> path=... to match Starlette's StaticFiles param name; every other template already used path= (home.html) Verified locally: all routes and static assets return 200. Co-Authored-By: Claude Sonnet 4.5 --- src/backend/core/core.py | 2 +- src/backend/core/tools.py | 2 +- src/backend/settings/consts.py | 4 +++- src/frontend/templates/home.html | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/backend/core/core.py b/src/backend/core/core.py index 8918283..ca40937 100644 --- a/src/backend/core/core.py +++ b/src/backend/core/core.py @@ -76,7 +76,7 @@ swot_agent = Agent( provider=OpenAIProvider(api_key=get_val("OPENAI_API_KEY")), ), deps_type=SwotAgentDeps, - result_type=SwotAnalysis, + output_type=SwotAnalysis, system_prompt=default_system_prompt, retries=5, ) diff --git a/src/backend/core/tools.py b/src/backend/core/tools.py index 2a55549..6dee7d9 100644 --- a/src/backend/core/tools.py +++ b/src/backend/core/tools.py @@ -166,7 +166,7 @@ async def get_reddit_insights( return "\n".join(insights) -@swot_agent.result_validator +@swot_agent.output_validator def validate_result( _ctx: RunContext[SwotAgentDeps], value: SwotAnalysis ) -> SwotAnalysis: diff --git a/src/backend/settings/consts.py b/src/backend/settings/consts.py index 7d5abd0..4ac7ee7 100644 --- a/src/backend/settings/consts.py +++ b/src/backend/settings/consts.py @@ -3,7 +3,9 @@ import os from decouple import config -BASE_DIR = os.path.join(os.path.dirname(os.path.dirname("__name__"))) +BASE_DIR = os.path.dirname( + os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +) BACKEND_DIR = os.path.join(BASE_DIR, "backend") FRONTEND_DIR = os.path.join(BASE_DIR, "frontend") diff --git a/src/frontend/templates/home.html b/src/frontend/templates/home.html index fd9b5fc..c4d0a44 100644 --- a/src/frontend/templates/home.html +++ b/src/frontend/templates/home.html @@ -4,7 +4,7 @@
- StrategIQ