Improve apis for cli#13
Conversation
| created_at=datetime.fromisoformat(data.get('created_at').replace('Z', '+00:00')) if data.get('created_at') else None, | ||
| updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None | ||
| updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None, | ||
| profile=mapConsumersGetMemberConsumerOutputProfile.from_dict(data.get('profile')) if data.get('profile') else None |
There was a problem hiding this comment.
Missing mapper classes cause NameError at runtime
High Severity
The from_dict methods reference mapper classes like mapConsumersGetMemberConsumerOutputProfile, mapDashboardInstanceConsumersGetMemberConsumerOutputProfile, and mapManagementInstanceConsumersGetMemberConsumerOutputProfile, but none of these classes are defined anywhere in the codebase. New dataclasses for the profile types were generated, but the corresponding mapper classes were not. This causes a NameError at runtime whenever a response includes a profile field. Affects all six get_member_consumer.py files across both API versions.
Additional Locations (2)
| updated_at=datetime.fromisoformat(data.get('updated_at').replace('Z', '+00:00')) if data.get('updated_at') else None, | ||
| is_portal_consumer=data.get('is_portal_consumer'), | ||
| is_organization_member=data.get('is_organization_member') | ||
| profile=mapConsumersGetMemberConsumerOutputProfile.from_dict(data.get('profile')) if data.get('profile') else None |
There was a problem hiding this comment.
Missing mapper classes cause NameError for profile deserialization
High Severity
The from_dict methods reference mapper classes like mapConsumersGetMemberConsumerOutputProfile, mapDashboardInstanceConsumersGetMemberConsumerOutputProfile, and mapManagementInstanceConsumersGetMemberConsumerOutputProfile that are never defined anywhere in the codebase. The dataclass definitions (e.g., ConsumersGetMemberConsumerOutputProfile) were generated, but the corresponding map* classes with from_dict/to_dict static methods were not. This causes a NameError at runtime whenever the API response includes a non-null profile field. Affects all six get_member_consumer.py files across both API versions.
Additional Locations (2)
|
|
||
| @staticmethod | ||
| def to_dict(value: Union[DashboardInstanceMagicMcpServersCreateOutputEndpoints, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: | ||
| if value is None: |
There was a problem hiding this comment.
Deleted mapper classes still referenced in from_dict methods
High Severity
The mapXxxOutputEndpoints mapper classes were deleted from all magic MCP server CRUD files (create, get, delete, update) in the mt_2025_01_01_dashboard version, but the from_dict methods still call them (e.g. mapDashboardInstanceMagicMcpServersCreateOutputEndpoints.from_dict(item)). Grep confirms these classes no longer exist anywhere in the mt_2025_01_01_dashboard tree, causing a NameError at runtime for every create/get/delete/update operation on magic MCP servers. This affects all three namespaces (dashboard, magic_mcp_servers, management) — 12 files total.
Additional Locations (2)
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
|
||
| @staticmethod | ||
| def to_dict(value: Union[MagicMcpServersCreateOutputEndpoints, Dict[str, Any], None]) -> Optional[Dict[str, Any]]: | ||
| if value is None: |
There was a problem hiding this comment.
Deleted endpoints mapper class still referenced in from_dict
High Severity
The mapXxxEndpoints mapper classes (e.g. mapMagicMcpServersCreateOutputEndpoints) were deleted from the magic MCP servers create.py, delete.py, get.py, and update.py files across all three namespaces (12 files total), but the from_dict methods still reference them via mapXxxEndpoints.from_dict(item). Since the classes no longer exist in these files and aren't imported, any call to from_dict will raise a NameError at runtime.


Note
Medium Risk
Medium risk because this is a regenerated client surface that changes method signatures and response model shapes (e.g., renamed fields and list item typing), which can break downstream CLI/client code at runtime or type-check time.
Overview
Adds new filtering and association options across generated endpoints:
Magic MCP serverslistnow supportspreconfigured_only,Magic MCP tokenslistcan be filtered bymagic_mcp_server_id, andprovider templateslistaddssearch.Updates Magic MCP token creation to replace
group_idswithmagic_mcp_group_idsand optionally bind a token to a singlemagic_mcp_server_id, and expands token responses to include an optionalserverobject.Refreshes several response models: magic MCP server objects gain
source(and optionalsession_idin create/get/update/delete outputs), session magic MCP server embeds switch fromsession_template_idtosource, consumer “member consumer” responses now return a structuredprofile(with optional groups) instead ofis_portal_consumer/is_organization_member, and magic MCP serverslistoutput now returnsitemsas rawDict[str, Any]rather than a typed item model.Written by Cursor Bugbot for commit a9f0faf. This will update automatically on new commits. Configure here.