Refactor existing context population code to support other scope types - #119
Conversation
There was a problem hiding this comment.
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
ScopeUtilswith overloaded methods to handle different scope types - Consolidated common tag population logic across scope types
- Replaced usage of
InvokeAgentScopeUtilswithScopeUtilsthroughout 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 |
Julio Carlos Menendez (juliomenendez)
left a comment
There was a problem hiding this comment.
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 open a new pull request to apply changes based on the comments in this thread |
|
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. |
Julio Carlos Menendez (juliomenendez)
left a comment
There was a problem hiding this comment.
Check the comments by Copilot.
…b.com/microsoft/Agent365-nodejs into users/pefan/contextpopulationrefactor
…s.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…s.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refactor existing context population code to support other scope types using overrides