fixed build error caused by incorrect field#255
Closed
aubreyquinn wants to merge 0 commit intomainfrom
Closed
Conversation
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesnodejs/langchain/sample-agent/package.json
nodejs/openai/sample-agent/package.json
nodejs/perplexity/sample-agent/package.json
OpenSSF Scorecard
Scanned Files
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a TypeScript build failure in the Perplexity Node.js sample agent by removing usage of a non-existent BaggageBuilder.correlationId setter and updating how correlation/user identity is placed into observability baggage.
Changes:
- Removed the
.correlationId(...)call fromBaggageBuilderusage. - Switched baggage identity fields from
.callerId/.callerNameto.userId/.userName. - Added correlation information via
.setPairs({ "correlation.id": ... }).
nikhilNava
previously approved these changes
Mar 25, 2026
| return cls._INSTRUCTIONS_TEMPLATE.replace("{user_name}", user_name) | ||
| # Setup OpenAI Agents instrumentation (handled in _setup_observability) | ||
| # Instrumentation is automatically configured during observability setup | ||
| pass |
| - Comprehensive error handling and cleanup | ||
| """ | ||
|
|
||
| import asyncio |
| InvokeAgentScope, | ||
| ) | ||
| from microsoft_agents_a365.observability.core.middleware.baggage_builder import BaggageBuilder | ||
| from microsoft_agents_a365.observability.core.tool_type import ToolType |
| ChatHistory chatHistory = turnState.GetValue("conversation.chatHistory", () => new ChatHistory()); | ||
|
|
||
| // Invoke the Agent365Agent to process the message | ||
| Agent365AgentResponse response = await agent365Agent.InvokeAgentAsync(turnContext.Activity.Text, chatHistory, turnContext); |
Comment on lines
+218
to
+223
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"There was an error processing the email notification: {ex.Message}"); | ||
| var responseEmailActivity = EmailResponse.CreateEmailResponseActivity("Unable to process your email at this time."); | ||
| await turnContext.SendActivityAsync(responseEmailActivity, cancellationToken); | ||
| } |
Comment on lines
+244
to
+249
| catch (Exception ex) | ||
| { | ||
| _logger.LogError($"There was an error processing the mention notification: {ex.Message}"); | ||
| var responseWpxActivity = MessageFactory.Text("Unable to process your mention comment at this time."); | ||
| await turnContext.SendActivityAsync(responseWpxActivity, cancellationToken); | ||
| } |
Comment on lines
+111
to
+119
| if (!TermsAndConditionsAccepted) | ||
| { | ||
| if (turnContext.Activity.ChannelId.Channel == Channels.Msteams) | ||
| { | ||
| var response = await agent365Agent.InvokeAgentAsync(turnContext.Activity.Text, new ChatHistory()); | ||
| await OutputResponseAsync(turnContext, turnState, response, cancellationToken); | ||
| return; | ||
| } | ||
| } |
| if (turnContext.Activity.Action == InstallationUpdateActionTypes.Add) | ||
| { | ||
| IsApplicationInstalled = true; | ||
| TermsAndConditionsAccepted = turnContext.IsAgenticRequest() ? true : false; |
Comment on lines
+266
to
+273
| if (turnContext.IsAgenticRequest()) | ||
| { | ||
| ObservabilityAuthHandlerName = AgenticIdAuthHandler; | ||
| } | ||
| else | ||
| { | ||
| ObservabilityAuthHandlerName = MyAuthHandler; | ||
| } |
bc065f9 to
dd6a12d
Compare
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.
BaggageBuilder does not have the field, correlationId. That was causing build failures.

Also, the dependency 'jose' was causing a runtime error because that dependency was using the ESM-only module system, but jwks-rsa@4 still uses require(). This is a known incompatibility. The fix is to pin jose to the last CJS-compatible version (v5.x).
Also, code linting issues have been fixed.