fix(mcp): use name URL param so AI-generated SQL Lab titles render#40288
fix(mcp): use name URL param so AI-generated SQL Lab titles render#40288msyavuz wants to merge 2 commits into
name URL param so AI-generated SQL Lab titles render#40288Conversation
`open_sql_lab_with_context` emitted `?title=...`, but SQL Lab's `PopEditorTab` only reads `?name=...` (the QueryEditor.name field), so the LLM-provided title was silently dropped and the tab opened with no label. Keep the MCP-facing field as `title` (natural for LLMs) but emit `name` on the URL, and sharpen the field description so the model actually generates a descriptive label from conversation context.
Code Review Agent Run #494efdActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
✅ Deploy Preview for superset-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #40288 +/- ##
==========================================
- Coverage 64.16% 64.14% -0.02%
==========================================
Files 2591 2591
Lines 138163 138230 +67
Branches 32048 32060 +12
==========================================
+ Hits 88650 88674 +24
- Misses 47984 48026 +42
- Partials 1529 1530 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
The PR comment indicates a logic error where the superset/mcp_service/sql_lab/tool/open_sql_lab_with_context.py |
Per review: `if request.title:` is truthy for `" "`, so a whitespace-only title would have rendered as a visually blank tab label instead of falling back to SQL Lab's default "Untitled Query N". Normalize at the schema level (strip, coerce empty → None) matching the existing `sql_not_empty`/`label_not_empty` validators in this file.
|
Bot comments should be resolved now |
SUMMARY
open_sql_lab_with_contextwas emitting?title=…on the generated/sqllabURL, but SQL Lab'sPopEditorTabonly reads?name=…(it destructuresnamestraight intoQueryEditor.name). The LLM-provided title was silently dropped, so MCP-opened tabs landed with no label at all — not evenUntitled Query N.Keep the MCP-facing field as
title(natural for LLMs), but emit it on the URL asnameto match the existing frontend convention. Also tightened the schema description so models actually generate a descriptive label from conversation context instead of leaving the field unset.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A — backend-only change to a URL query parameter; tab label is just the user-visible string.
TESTING INSTRUCTIONS
open_sql_lab_with_contextMCP tool with atitle(e.g."Top customers by revenue").pytest tests/unit_tests/mcp_service/sql_lab/tool/test_open_sql_lab_with_context.py.ADDITIONAL INFORMATION