Skip to content

Removing BasicCard, MediaType, ClaimsIdentity.is_authenticated - #603

Merged
Rodrigo Brandão (rodrigobr-msft) merged 6 commits into
mainfrom
users/robrandao/obsolete-sweep
Sep 25, 2026
Merged

Rodrigo Brandão (rodrigobr-msft) merged 6 commits into
mainfrom
users/robrandao/obsolete-sweep

Conversation

@rodrigobr-msft

@rodrigobr-msft Rodrigo Brandão (rodrigobr-msft) commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

This pull request removes deprecated card types and related code from the microsoft_agents.activity library, and cleans up deprecated authentication logic in the ClaimsIdentity class and related usages. It also updates tests and sample code to reflect these removals. The changes simplify the codebase by eliminating obsolete features, reducing maintenance overhead, and clarifying the supported API surface.

Removal of deprecated card types and related code:

  • Removed BasicCard and MediaCard classes and all their imports/exports from the microsoft_agents.activity package. This includes deleting their source files and removing them from the module's __init__.py and test imports. ([[1]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-31cb72ea23ff32a2ccb5b68267163cf524218b1630beaa35e920da3b11b69eaaL20), [[2]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-31cb72ea23ff32a2ccb5b68267163cf524218b1630beaa35e920da3b11b69eaaL60), [[3]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-31cb72ea23ff32a2ccb5b68267163cf524218b1630beaa35e920da3b11b69eaaL130), [[4]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-31cb72ea23ff32a2ccb5b68267163cf524218b1630beaa35e920da3b11b69eaaL161), [[5]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-a4b25422e112e3736c0c8ce6f3ff10765e9d23ddd3533ded868603ed82c7b2c4L1-L137), [[6]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-90c33efbe60320a4e3b60dbc5e50c5f8634e08eaf60fbf7d5d7d2a2cbd82f400L1-L117), [[7]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-8805296e5f3dc1eaf773f05f5668498d8f70fde724e834607c6893f900d62e1eL9-L15), [[8]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-8805296e5f3dc1eaf773f05f5668498d8f70fde724e834607c6893f900d62e1eL57-R62), [[9]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-8805296e5f3dc1eaf773f05f5668498d8f70fde724e834607c6893f900d62e1eL92-L95))
  • Updated or removed tests that referenced BasicCard or MediaCard, focusing tests on supported card types only. ([[1]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-8805296e5f3dc1eaf773f05f5668498d8f70fde724e834607c6893f900d62e1eL57-R62), [[2]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-8805296e5f3dc1eaf773f05f5668498d8f70fde724e834607c6893f900d62e1eL92-L95))

Authentication and identity cleanup:

  • Removed all deprecated is_authenticated logic from the ClaimsIdentity class, including constructor parameters, properties, and warnings. All usages of is_authenticated in the codebase and tests have been removed or updated. ([[1]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-f3ad7cc4c139eca4411fa8e119260af6d21980893c040c0fd967b41c832f1ceaL19-L47), [[2]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-f3ad7cc4c139eca4411fa8e119260af6d21980893c040c0fd967b41c832f1ceaL65-L83), [[3]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-e111c36bbe05a7db21863f1b011f1e952e89d901de5bee93d2ff5f8b4e180b82L107-R107), [[4]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-2ce8f71e1b0b200291cc7bd1ea89987c6e1fa85023a3e9905f6d1a3c24bda256L65), [[5]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-2ce8f71e1b0b200291cc7bd1ea89987c6e1fa85023a3e9905f6d1a3c24bda256L83-L98), [[6]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-2ce8f71e1b0b200291cc7bd1ea89987c6e1fa85023a3e9905f6d1a3c24bda256L116), [[7]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-f4344ed30f62bfa2f55521b9462bd17cc7cf1158580a72bd695cfac8d4c4f51aL79-R79), [[8]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-4f32020d5d0e459579ab343c1763a7e335e7cf06dc28989a1d2291d929562e5eL57-R60))
  • Updated instantiations of ClaimsIdentity in tests and sample code to remove the is_authenticated parameter and, where appropriate, set the authentication_type explicitly. ([[1]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-e111c36bbe05a7db21863f1b011f1e952e89d901de5bee93d2ff5f8b4e180b82L107-R107), [[2]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-f4344ed30f62bfa2f55521b9462bd17cc7cf1158580a72bd695cfac8d4c4f51aL79-R79), [[3]](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-4f32020d5d0e459579ab343c1763a7e335e7cf06dc28989a1d2291d929562e5eL57-R60))

General codebase cleanup:

  • Removed the deprecated parse_env_vars_configuration static method from AgentApplication, as configuration loading should use the recommended alternative. ([libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/app/agent_application.pyL902-L934](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-a0c0028a01efc798e89b84f1bca0d4323b71753bd6f43d02800f29e66bc766a6L902-L934))
  • Removed a deprecated alias for ContentTypes in card_factory.py. ([libraries/microsoft-agents-hosting-core/microsoft_agents/hosting/core/card_factory.pyL163-L165](https://github.com/microsoft/Agents-for-python/pull/603/files#diff-57847651a925caedb3a1eb0f850619cc63d00dc4110e7aac963779fa9b1c1909L163-L165))

These changes help keep the library up-to-date, reduce confusion for users, and make the codebase easier to maintain.

@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) marked this pull request as ready for review September 24, 2026 23:10
@rodrigobr-msft Rodrigo Brandão (rodrigobr-msft) changed the title Make some deprecated features obsolete Removing BasicCard, MediaType, ClaimsIdentity.is_authenticated, and creation of UserTokenClient without an app ID Sep 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Remaining references, incompatible constructor call sites, and the broken anonymous token-client path cause runtime and test failures.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 4 High severity · 3 Low severity

Open (7)
What changed in this PR

Removes deprecated card, identity, configuration, and token-client compatibility APIs.

Changes:

  • Deletes BasicCard, MediaCard, and related exports/tests.
  • Removes deprecated ClaimsIdentity.is_authenticated support.
  • Removes legacy helpers and requires UserTokenClient.app_id.
File Description
tests/​activity/​test_card_builders.py Removes BasicCard coverage.
test_samples/​app_style/​echo_proactive_agent.py Removes persisted authentication state.
libraries/​.../​user_token_client.py Makes app ID mandatory.
libraries/​.../​card_factory.py Removes the content-types alias.
libraries/​.../​claims_identity.py Removes is_authenticated.
libraries/​.../​agent_application.py Removes legacy environment parsing.
libraries/​.../​media_card.py Deletes MediaCard.
libraries/​.../​basic_card.py Deletes BasicCard.
libraries/​.../​activity/​__init__.py Removes card imports and exports.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread test_samples/app_style/echo_proactive_agent.py
Comment thread tests/activity/test_card_builders.py
@rodrigobr-msft Rodrigo Brandão (rodrigobr-msft) changed the title Removing BasicCard, MediaType, ClaimsIdentity.is_authenticated, and creation of UserTokenClient without an app ID Removing BasicCard, MediaType, ClaimsIdentity.is_authenticated Sep 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

Remaining positional identity calls are now misbound, and removed deprecated code leaves unused imports that fail linting.

Review effort: Balanced
Findings: None

Resolved since last review (7)

@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) merged commit ebd95fb into main Sep 25, 2026
10 checks passed
@rodrigobr-msft
Rodrigo Brandão (rodrigobr-msft) deleted the users/robrandao/obsolete-sweep branch September 25, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants