diff --git a/server.py b/server.py index 866a6cf..e50b841 100644 --- a/server.py +++ b/server.py @@ -1589,7 +1589,14 @@ async def run_plan_visualization(run_id: str, request: Request): ''' # Add collapsible Plan JSON section - plan_json_str = json.dumps(plan_data, indent=2) + # Parse nested plan_json if present (it's double-encoded as a string) + display_plan = plan_data.copy() + if "plan_json" in display_plan and isinstance(display_plan["plan_json"], str): + try: + display_plan["plan_json"] = json.loads(display_plan["plan_json"]) + except json.JSONDecodeError: + pass + plan_json_str = json.dumps(display_plan, indent=2) # Escape HTML entities in JSON plan_json_str = plan_json_str.replace("&", "&").replace("<", "<").replace(">", ">") content += f'''