rusackas commented on code in PR #43388:
URL: https://github.com/apache/superset/pull/43388#discussion_r3845267959
##########
superset/mcp_service/__main__.py:
##########
@@ -77,12 +79,16 @@ def _add_default_middlewares() -> None:
for middleware in build_middleware_list():
mcp.add_middleware(middleware)
- # Response size guard is innermost (added last)
+ # Response size guard is innermost (added last), then response caching.
if size_guard := create_response_size_guard_middleware():
mcp.add_middleware(size_guard)
limit = size_guard.token_limit
sys.stderr.write(f"[MCP] Response size guard enabled
(token_limit={limit})\n")
+ if caching_middleware := create_response_caching_middleware():
Review Comment:
Fixed. Response caching now excludes every tool with a side effect by
default, derived from each tool's own `readOnlyHint` annotation rather than a
hand-maintained list — that list had drifted (18 mutating tools including
`restore_chart`/`restore_dashboard` were missing, not just these two). Added
`test_excluded_tools_covers_every_mutating_tool`, which enumerates the live
tool registry and fails with the specific missing tool name(s) if this ever
drifts again.
##########
superset/mcp_service/system/tool/find_users.py:
##########
@@ -75,7 +77,6 @@ async def find_users(request: FindUsersRequest, ctx: Context)
-> FindUsersRespon
user_model.username.ilike(needle, escape="\\"),
Review Comment:
Fixed. Added a `field_validator` on `FindUsersRequest.query` that rejects
email-shaped input outright (a simple shape check, not RFC validation) before
it ever reaches the DB filter, plus a regression test covering the rejection
and confirming the DB layer isn't touched.
--
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]