sadpandajoe commented on code in PR #43133:
URL: https://github.com/apache/superset/pull/43133#discussion_r3808979447


##########
superset/mcp_service/dashboard/tool/generate_dashboard.py:
##########
@@ -262,13 +322,19 @@ def generate_dashboard(  # noqa: C901
                     )
 
         # Create dashboard layout with chart objects.
-        # If the caller provided an explicit position_json, use it verbatim;
-        # otherwise auto-generate a packed-grid layout from the chart ids.
+        # Invalid explicit layouts make frontend hydration fail before chart
+        # queries start, so fall back to the known-good packed grid.
         with event_logger.log_context(action="mcp.generate_dashboard.layout"):
-            if request.position_json:
+            if request.position_json and _is_valid_dashboard_layout(

Review Comment:
   The tool description still tells callers that supplied `position_json` is 
written verbatim, but this branch now silently substitutes the packed grid for 
invalid input. Could the caller-facing description be updated to explain the 
fallback so an invalid custom layout is not mistaken for a preserved one?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to