Fix observability SDK breaking changes for Copilot Studio sample#269
Open
Yogeshp-MSFT wants to merge 1 commit intomicrosoft:mainfrom
Open
Fix observability SDK breaking changes for Copilot Studio sample#269Yogeshp-MSFT wants to merge 1 commit intomicrosoft:mainfrom
Yogeshp-MSFT wants to merge 1 commit intomicrosoft:mainfrom
Conversation
…est handling in McsClient
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Copilot Studio Node.js sample to compile and run against the @microsoft/agents-a365-observability 0.1.0-preview.125 breaking API changes, aligning it with the newer observability SDK patterns used by other samples.
Changes:
- Bumps Agent 365 SDK package versions to
^0.1.0-preview.125. - Migrates
InferenceScope.start()usage to the new(request, inferenceDetails, agentDetails)signature and removes deprecated APIs. - Updates baggage construction to remove the deprecated
BaggageBuilder.correlationId()call.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| nodejs/copilot-studio/sample-agent/src/client.ts | Updates observability imports and adapts inference scope creation to the new Request-based signature. |
| nodejs/copilot-studio/sample-agent/src/agent.ts | Removes deprecated baggage builder chaining method. |
| nodejs/copilot-studio/sample-agent/package.json | Updates Agent 365 SDK dependency versions to preview.125. |
Comments suppressed due to low confidence (1)
nodejs/copilot-studio/sample-agent/src/client.ts:156
- In the error path you record the exception but never set a finish reason, so failed inferences may show up without a terminal status in telemetry. Align with other samples by recording an explicit finish reason (e.g.,
['error']) before rethrowing.
} catch (error) {
scope.recordError(error as Error);
throw error;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Aligns the Copilot Studio Node.js sample with the
@microsoft/agents-a365-observabilityv0.1.0-preview.125 API, matching the patterns already adopted by the LangChain, Claude, OpenAI, and Vercel SDK samples.Problem
The Copilot Studio sample was pinned to
preview.30/preview.64SDK versions while the observability API had breaking changes inpreview.125. This caused 3 TypeScript compilation errors:conversationIddoes not exist in typeAgentDetailsInferenceDetailshas no properties in common with typeRequestrecordResponseIddoes not exist on typeInferenceScopeChanges
package.json — Updated SDK version
agents-a365-notifications^0.1.0-preview.30^0.1.0-preview.125agents-a365-observability^0.1.0-preview.30^0.1.0-preview.125agents-a365-observability-hosting^0.1.0-preview.64^0.1.0-preview.125agents-a365-runtime^0.1.0-preview.30^0.1.0-preview.125src/client.ts — Update imports
TenantDetailsimport (type no longer needed)Requestimport (new first parameter forInferenceScope.start)src/client.ts — Update
invokeInferenceScope()Requestobject (~L127) withconversationId(previously onAgentDetails)tenantIdintoAgentDetails(~L137) instead of a separateTenantDetailsobjectInferenceScope.start()call (~L143) from(inferenceDetails, agentDetails, tenantDetails)→(request, inferenceDetails, agentDetails)scope.recordResponseId()call (method removed in new SDK)src/agent.ts — Remove
.correlationId()from BaggageBuilder chain.correlationId(corr-${Date.now()})call (~L91) — method no longer exists onBaggageBuilderin the updated SDK