Skip to content

Conversation

@howieleung
Copy link
Member

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements code generation updates for the Azure AI Projects SDK, including API model changes, type safety improvements, and security enhancements.

Changes:

  • Replaced eval() calls with explicit type conversions in serialization/deserialization logic for security
  • Introduced PageOrder enum to replace string literals for pagination ordering
  • Added support for array encoding formats (pipe/comma/space/newline delimited) in model serialization
  • Renamed multiple models and enums (e.g., ItemParamItem, A2AToolA2APreviewTool, various tool model renames)
  • Added deserialization caching mechanism for mutable types to ensure proper mutation handling
  • Added numerous new enum types and model classes for new API features (ApplyPatch, FunctionShell, CustomTool, etc.)

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
azure/ai/projects/_utils/serialization.py Replaced unsafe eval() calls with explicit type conversions (int/float/bool) for security
azure/ai/projects/_utils/model_base.py Added array encoding support, deserialization caching for mutable types, and backcompat attribute handling
azure/ai/projects/_types.py Added new type alias ComparisonFilterValueItems
azure/ai/projects/models/_enums.py Large refactor: reordered enum values, added many new enum types (ApplyPatch*, FunctionShell*, CustomTool*, etc.), removed deprecated enums
azure/ai/projects/models/init.py Extensive model renames and additions reflecting API changes
azure/ai/projects/operations/_operations.py Updated type hints from Literal["asc", "desc"] to Union[str, PageOrder], renamed ItemParam to Item
azure/ai/projects/aio/operations/_operations.py Same async version of operations changes
tests/finetuning/*.py Added pylint suppressions for line-too-long
tests/agents/tools/test_agent_tools_with_conversations.py Added pylint suppressions
tests/conftest.py Added blank line (cosmetic)
samples/agents/tools/*.py Added pylint suppressions
apiview-properties.json Updated cross-language package mappings for renamed models

):
# encoded string may be deserialized to sequence
return deserializer(obj)
except: # pylint: disable=bare-except
Copy link

Copilot AI Jan 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The use of a bare except clause is a security and maintainability concern. While pylint is disabled for this line, bare except clauses can catch system exceptions like SystemExit and KeyboardInterrupt, making it difficult to terminate the program. Consider catching specific exceptions instead, such as (TypeError, AttributeError, IndexError) which are likely the exceptions that could be raised when checking the deserializer structure.

Suggested change
except: # pylint: disable=bare-except
except (TypeError, AttributeError, IndexError):

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

github-actions bot commented Jan 13, 2026

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-ai-projects

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants