bito-code-review[bot] commented on code in PR #39919:
URL: https://github.com/apache/superset/pull/39919#discussion_r3214170824
##########
superset/mcp_service/chart/tool/update_chart.py:
##########
@@ -337,17 +338,20 @@ async def update_chart( # noqa: C901
chart = find_chart_by_identifier(request.identifier)
if not chart:
+ safe_id = sanitize_for_llm_context(
+ str(request.identifier)[:200], field_path=("identifier",)
+ )
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Error Message Sanitization</b></div>
<div id="fix">
The use of `sanitize_for_llm_context` wraps the identifier with
`<UNTRUSTED-CONTENT>` delimiters in the error message, which is not appropriate
for user-facing output. Please replace it with
`escape_llm_context_delimiters(str(request.identifier)[:200])` and import
`escape_llm_context_delimiters` from `superset.mcp_service.utils` to escape any
existing delimiters without wrapping.
</div>
</div>
<small><i>Code Review Run #f75ead</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]