Skip to content

Refactor existing context population code to support other scope types - #119

Merged
PengF (fpfp100) merged 17 commits into
mainfrom
users/pefan/contextpopulationrefactor
Dec 18, 2025
Merged

Refactor existing context population code to support other scope types#119
PengF (fpfp100) merged 17 commits into
mainfrom
users/pefan/contextpopulationrefactor

Conversation

@fpfp100

@fpfp100 PengF (fpfp100) commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Refactor existing context population code to support other scope types using overrides

@fpfp100 PengF (fpfp100) changed the title refactor existing context population code to support other scope types Refactor existing context population code to support other scope types Dec 15, 2025
@fpfp100
PengF (fpfp100) marked this pull request as ready for review December 15, 2025 18:31
@fpfp100
PengF (fpfp100) requested review from a team as code owners December 15, 2025 18:31
Copilot AI review requested due to automatic review settings December 15, 2025 18:31

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.

Pull request overview

This PR refactors the observability scope utilities to support multiple scope types (InvokeAgentScope, InferenceScope, ExecuteToolScope) through a unified ScopeUtils class, replacing the previous InvokeAgentScopeUtils that was specific to InvokeAgentScope only.

Key Changes:

  • Introduced ScopeUtils with overloaded methods to handle different scope types
  • Consolidated common tag population logic across scope types
  • Replaced usage of InvokeAgentScopeUtils with ScopeUtils throughout the codebase

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts New unified utility class with scope-specific population logic and method overloads
packages/agents-a365-observability-hosting/src/utils/InvokeAgentScopeUtils.ts Removed the InvokeAgentScope-specific utility class
packages/agents-a365-observability-hosting/src/index.ts Updated export to use ScopeUtils instead of InvokeAgentScopeUtils
tests-agent/basic-agent-sdk-sample/src/agent.ts Updated import and usage from InvokeAgentScopeUtils to ScopeUtils
tests/observability/extension/hosting/scope-utils.test.ts New test file for the unified ScopeUtils functionality
tests/observability/extension/hosting/InvokeAgentScopeUtils.test.ts Removed old test file for InvokeAgentScopeUtils

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Take a look at the Copilot feedback on the tests.

@fpfp100

Copy link
Copy Markdown
Contributor Author

Take a look at the Copilot feedback on the tests.

The code is updated to leverage existing scope start method and expose helper methods to derive parameters used to build the scope. Tests are verifying individual attributes.

Copilot AI review requested due to automatic review settings December 16, 2025 23:50

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 14 comments.

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability/src/tracing/scopes/InvokeAgentScope.ts Outdated
Comment thread packages/agents-a365-observability/src/tracing/scopes/InvokeAgentScope.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts Outdated
Comment thread tests-agent/basic-agent-sdk-sample/src/agent.ts Outdated
Comment thread packages/agents-a365-observability/src/tracing/scopes/InvokeAgentScope.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
@fpfp100

Copy link
Copy Markdown
Contributor Author

Copilot open a new pull request to apply changes based on the comments in this thread

Copilot AI commented Dec 17, 2025

Copy link
Copy Markdown
Contributor

PengF (@fpfp100) I've opened a new pull request, #120, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Check the comments by Copilot.

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread tests-agent/basic-agent-sdk-sample/src/agent.ts Outdated
Copilot AI review requested due to automatic review settings December 17, 2025 20:11

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.

Pull request overview

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

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Copilot AI review requested due to automatic review settings December 17, 2025 21:50

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread tests/observability/extension/hosting/scope-utils.test.ts
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts Outdated
…s.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings December 17, 2025 22:01
…s.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

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.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Comment thread packages/agents-a365-observability-hosting/src/utils/ScopeUtils.ts
Comment thread packages/agents-a365-observability/src/tracing/scopes/InvokeAgentScope.ts Outdated
@fpfp100
PengF (fpfp100) merged commit 550847e into main Dec 18, 2025
7 checks passed
@fpfp100
PengF (fpfp100) deleted the users/pefan/contextpopulationrefactor branch December 18, 2025 17:33
@fpfp100
PengF (fpfp100) restored the users/pefan/contextpopulationrefactor branch December 18, 2025 22:31
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.

6 participants