codeant-ai-for-open-source[bot] commented on code in PR #41698:
URL: https://github.com/apache/superset/pull/41698#discussion_r3545791755


##########
superset/mcp_service/constants.py:
##########
@@ -28,3 +28,4 @@
 # Response size guard defaults
 DEFAULT_TOKEN_LIMIT = 25_000  # ~25k tokens prevents overwhelming LLM context 
windows
 DEFAULT_WARN_THRESHOLD_PCT = 80  # Log warnings above 80% of limit
+DEFAULT_MAX_LIST_ITEMS = 100  # Phase 2 list-field truncation cap; matches 
MAX_PAGE_SIZE

Review Comment:
   **Suggestion:** Add an explicit type annotation to this new constant so it 
complies with the required type-hinting rule for newly introduced variables. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   The rule requires new or modified Python code to include type hints on 
relevant variables that can be annotated. This newly added constant is untyped, 
and because it is a module-level constant with a clear int type, the omission 
is a real rule violation.
   </details>
   <details>
   <summary><b>Rule source 📖 </b></summary>
   
   .cursor/rules/dev-standard.mdc (line 28)
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=fcb0a50389f043a0b737683c538215b9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=fcb0a50389f043a0b737683c538215b9&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/mcp_service/constants.py
   **Line:** 31:31
   **Comment:**
        *Custom Rule: Add an explicit type annotation to this new constant so 
it complies with the required type-hinting rule for newly introduced variables.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41698&comment_hash=e9b8a1ea5418c85eebab495416dc8001df81928cb106a66e143b59ceee6b4776&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41698&comment_hash=e9b8a1ea5418c85eebab495416dc8001df81928cb106a66e143b59ceee6b4776&reaction=dislike'>👎</a>



##########
superset/mcp_service/utils/token_utils.py:
##########
@@ -469,8 +471,9 @@ def _get_tool_specific_suggestions(
 
 # Maximum character length for string fields before truncation
 _MAX_STRING_CHARS = 500
-# Maximum items to keep in list fields before truncation
-_MAX_LIST_ITEMS = 30
+# Maximum items to keep in list fields before truncation (configurable via
+# MCP_RESPONSE_SIZE_CONFIG["max_list_items"])
+_MAX_LIST_ITEMS = DEFAULT_MAX_LIST_ITEMS

Review Comment:
   **Suggestion:** Add an explicit type annotation to this new module-level 
constant so the new code complies with the required type-hint rule. 
[custom_rule]
   
   **Severity Level:** Minor ⚠️
   <details>
   <summary><b>Why it matters? 🤔 </b></summary>
   
   This is a newly added module-level variable that can be annotated, and it 
currently lacks an explicit type hint. That matches the stated Python type-hint 
rule.
   </details>
   <details>
   <summary><b>Rule source 📖 </b></summary>
   
   .cursor/rules/dev-standard.mdc (line 28)
   </details>
   
   [![Fix in 
Cursor](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-cursor-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=ab49c1e8602d4a4ab2862eef88310201&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
 [![Fix in VSCode 
Claude](https://new-codeant-butcket.s3.us-west-1.amazonaws.com/badges/fix-in-vscode-claude-flat.svg)](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=ab49c1e8602d4a4ab2862eef88310201&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
   
   *(Use Cmd/Ctrl + Click for best experience)*
   <details>
   <summary><b>Prompt for AI Agent 🤖 </b></summary>
   
   ```mdx
   This is a comment left during a code review.
   
   **Path:** superset/mcp_service/utils/token_utils.py
   **Line:** 476:476
   **Comment:**
        *Custom Rule: Add an explicit type annotation to this new module-level 
constant so the new code complies with the required type-hint rule.
   
   Validate the correctness of the flagged issue. If correct, How can I resolve 
this? If you propose a fix, implement it and please make it concise.
   Once fix is implemented, also check other comments on the same PR, and ask 
user if the user wants to fix the rest of the comments as well. if said yes, 
then fetch all the comments validate the correctness and implement a minimal fix
   ```
   </details>
   <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41698&comment_hash=d4c398315de0b63b841344764ff7ad437e40cedf55f0f44c2fe484fde75d4bfc&reaction=like'>👍</a>
 | <a 
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41698&comment_hash=d4c398315de0b63b841344764ff7ad437e40cedf55f0f44c2fe484fde75d4bfc&reaction=dislike'>👎</a>



-- 
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