feat(mcp): add list and get tools for action log and tasks#6
Open
hbrooks wants to merge 13 commits into
Open
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The injected 7-day default filter used a datetime object as the value, but ActionLogFilter.value only allows str|int|float|bool|list. Pydantic rejects the datetime when building the filters_applied list in ActionLogList, causing a ValidationError on every call that triggered the default filter. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add model_serializer to ActionLogInfo and TaskInfo that drops non-requested fields from output when select_columns context is set, matching the DatabaseInfo pattern - Switch list_action_logs and list_tasks to return model_dump with serialization context so only requested columns appear in responses - Add search field + search-XOR-filters validator to ListActionLogsRequest and ListTasksRequest - Pass search=request.search through to ModelListCore.run_tool() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rage - Add task_key and task_name fields to TaskInfo schema and ALL_TASK_COLUMNS; these are real Task model columns present in the REST API search_columns - Expand search_columns in list_tasks to include task_key and task_name - Strengthen test_list_action_logs_default_7day_filter_applied to also assert the injected filter appears in filters_applied with an ISO string value Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pydantic v2 rejects a ColumnOperator instance when validating list[ActionLogFilter] — it requires an exact instance or dict, not a parent-class instance. The injected 7-day default dttm filter was created as a plain ColumnOperator, causing every test_list_action_logs_* call to fail with '1 validation error for ActionLogList'. Fix: construct the default filter as ActionLogFilter (which is a subclass of ColumnOperator), so it passes pydantic validation for ActionLogList.filters_applied: list[ActionLogFilter] and is still accepted everywhere ColumnOperator is expected.
…ests - Normalize changed_on/created_on naive datetimes in serialize_task_object (mirrors serialize_action_log_object pattern for dttm) - Add filter-forwarding assertion to test_list_tasks_with_status_filter - Add id_column="uuid" assertion to test_get_task_info_by_uuid Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…permissions The ADMIN-ONLY label was misleading — access is gated by the Log permission in Superset's RBAC, not a hard admin check. Updated both docstrings to describe the actual permission model.
…docs - Add model_validator to ActionLogFilter to parse ISO string dttm values to timezone-aware datetime objects, preventing VARCHAR bind mismatch on Postgres TIMESTAMP columns (Pydantic's left-to-right union keeps strings as str when str precedes datetime in the union) - Feed config-guard removed tools (action-log, task) into disabled_tools before calling get_default_instructions so removed tools are never advertised in LLM instructions - Add Action Logs and Task Management sections to get_default_instructions output; existing per-line filtering strips them when tools are disabled - Update test assertions and add new coverage for both behaviors
The stored log `json` field is user-controlled data. Parse it and run each string leaf through `sanitize_for_llm_context` so the payload cannot masquerade as instructions when placed in an LLM context. Preserves the JSON shape (dict/list structure) so callers can still inspect individual fields; only string leaves are wrapped in UNTRUSTED-CONTENT delimiters. Falls back to sanitizing the raw string when the payload is not valid JSON. Addresses review feedback from richardfogaca.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Originally PR apache#40344 in apache/superset by @aminghadersohi