fix: Make debug parameter work as Query parameter in /api/prompts/execute
All checks were successful
Deploy Development / deploy (push) Successful in 49s
Build Test / pytest-backend (push) Successful in 4s
Build Test / lint-backend (push) Successful in 1s
Build Test / build-frontend (push) Successful in 17s

Bug: debug=true in URL was ignored because FastAPI expected it in
request body (POST without Query() expects body params by default).

Result: node_states were never returned, even with ?debug=true

Fix: Changed debug and save to Query parameters:
- debug: bool = Query(False, ...)
- save: bool = Query(False, ...)

Now ?debug=true in URL correctly enables debug output with node_states.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lars 2026-04-13 09:14:30 +02:00
parent 057df0afc8
commit 790e6df8ef

View File

@ -1447,11 +1447,11 @@ from models import UnifiedPromptCreate, UnifiedPromptUpdate
@router.post("/execute")
async def execute_unified_prompt(
prompt_slug: str,
prompt_slug: str = Query(..., description="Slug of prompt to execute"),
modules: Optional[dict] = None,
timeframes: Optional[dict] = None,
debug: bool = False,
save: bool = False,
debug: bool = Query(False, description="Include debug information (node_states, etc.)"),
save: bool = Query(False, description="Save result to ai_insights"),
session: dict = Depends(require_auth)
):
"""