Fix double-encoded JSON in Plan JSON display
Parse nested plan_json field before displaying to avoid escaped newlines. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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'''
|
||||
|
||||
Reference in New Issue
Block a user