Bug-Fixing Analyse Fehler #87

Merged
Lars merged 20 commits from develop into main 2026-04-18 09:54:12 +02:00
Showing only changes of commit 36478863a2 - Show all commits

View File

@ -30,9 +30,9 @@ from placeholder_resolver import (
OPENROUTER_KEY = os.getenv("OPENROUTER_API_KEY") OPENROUTER_KEY = os.getenv("OPENROUTER_API_KEY")
OPENROUTER_MODEL = os.getenv("OPENROUTER_MODEL", "anthropic/claude-sonnet-4") OPENROUTER_MODEL = os.getenv("OPENROUTER_MODEL", "anthropic/claude-sonnet-4")
router = APIRouter(prefix=/api/prompts, tags=[prompts]) router = APIRouter(prefix="/api/prompts", tags=["prompts"])
# Metadaten-Schlüssel in workflow aggregate_results (nicht als „einziger Nutzer-Output) # Metadaten-Schlüssel in workflow aggregate_results (nicht als „einziger Nutzer-Output)
_WORKFLOW_AGG_META_KEYS = frozenset({ _WORKFLOW_AGG_META_KEYS = frozenset({
"combined_analysis", "combined_analysis",
"all_signals", "all_signals",
@ -1547,17 +1547,6 @@ async def execute_unified_prompt_stream(
) )
conn.commit() conn.commit()
# Client (EventSource) wartet auf dieses Event; ohne Payload schließt der Stream
# und der Browser feuert onerror → „Connection to server lost“.
try:
sse_payload = json.loads(json.dumps(result, default=str))
except (TypeError, ValueError):
sse_payload = {"type": result.get("type", "unknown"), "error": "result_not_serializable"}
await event_queue.put({
"type": "execution_complete",
"result": sse_payload,
})
except Exception as e: except Exception as e:
# Queue error event # Queue error event
await event_queue.put({ await event_queue.put({