Skip to content

Remove redundant null check in conversation ID extraction#64

Merged
nikhilNava merged 2 commits intonikhilc/addExporterOptionsfrom
copilot/sub-pr-63
Nov 19, 2025
Merged

Remove redundant null check in conversation ID extraction#64
nikhilNava merged 2 commits intonikhilc/addExporterOptionsfrom
copilot/sub-pr-63

Conversation

Copy link
Contributor

Copilot AI commented Nov 19, 2025

The _iter_conversation_pairs function had a redundant conditional check that served no purpose. The variable conversation_id was initialized to None and immediately checked with if not conversation_id:, which would always evaluate to True.

Changes

  • Removed unnecessary conversation_id = None initialization and if not conversation_id: check
  • Extract conversation ID directly from activity without intermediate conditional

Before:

def _iter_conversation_pairs(activity: Any) -> Iterator[tuple[str, Any]]:
    conversation_id = None

    if not conversation_id:
        conv = _safe_get(activity, "conversation")
        conversation_id = _safe_get(conv, "id")
    # ...

After:

def _iter_conversation_pairs(activity: Any) -> Iterator[tuple[str, Any]]:
    conv = _safe_get(activity, "conversation")
    conversation_id = _safe_get(conv, "id")
    # ...

The logic appears to be leftover from previous refactoring where entity-based conversation ID extraction was removed.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@nikhilNava nikhilNava marked this pull request as ready for review November 19, 2025 20:17
@nikhilNava nikhilNava requested a review from a team as a code owner November 19, 2025 20:17
Copilot AI changed the title [WIP] Update exporter options and functionality improvements Remove redundant null check in conversation ID extraction Nov 19, 2025
Copilot AI requested a review from nikhilNava November 19, 2025 20:17
@nikhilNava nikhilNava merged commit addb816 into nikhilc/addExporterOptions Nov 19, 2025
1 check passed
@nikhilNava nikhilNava deleted the copilot/sub-pr-63 branch November 19, 2025 20:18
nikhilNava added a commit that referenced this pull request Nov 20, 2025
* updates to baggage and scope

* add tests for new functionality

* fix tests

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/invoke_agent_scope.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter_options.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/exporters/agent365_exporter_options.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/config.py

Co-authored-by: Copilot <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py

Co-authored-by: Copilot <[email protected]>

* Remove redundant null check in conversation ID extraction (#64)

* Initial plan

* Remove redundant condition in _iter_conversation_pairs

Co-authored-by: nikhilNava <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: nikhilNava <[email protected]>

* Fix copyright header in utils.py to use standard Microsoft format (#65)

* Initial plan

* Fix copyright header in utils.py to use standard Microsoft format

Co-authored-by: nikhilNava <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: nikhilNava <[email protected]>

* Update libraries/microsoft-agents-a365-observability-core/microsoft_agents_a365/observability/core/middleware/baggage_builder.py

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: Nikhil Chitlur Navakiran (from Dev Box) <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: nikhilNava <[email protected]>
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.

2 participants