From 42bcfe218a3ea43012481ec7010ea0be8118e7e3 Mon Sep 17 00:00:00 2001 From: "Nikhil Chitlur Navakiran (from Dev Box)" Date: Mon, 14 Sep 2026 07:19:20 -0600 Subject: [PATCH 1/2] fix(a365): default invoke agent spans to internal Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ccc29b9-bf5d-4725-be3b-c4276b233c4c --- CHANGELOG.md | 3 +++ src/a365/scopes/InvokeAgentScope.ts | 5 +++-- test/internal/unit/a365/scopes.test.ts | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d61c5f77..25fe4e67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## [Unreleased] +### Bugs Fixed +- Default `InvokeAgentScope` spans to `SpanKind.INTERNAL` while preserving explicit span-kind overrides. + ### Other Changes - Consolidate Dependabot updates for Vitest 4.1.11, Hono 4.13.7, qs 6.16.0, fast-uri 3.1.7, actions/deploy-pages 5.0.1, and actions/checkout 7.0.1. diff --git a/src/a365/scopes/InvokeAgentScope.ts b/src/a365/scopes/InvokeAgentScope.ts index bcfda81b..02f23c68 100644 --- a/src/a365/scopes/InvokeAgentScope.ts +++ b/src/a365/scopes/InvokeAgentScope.ts @@ -25,7 +25,8 @@ export class InvokeAgentScope extends OpenTelemetryScope { * @param invokeScopeDetails Scope-level details (endpoint). * @param agentDetails The agent identity. `tenantId` is required. * @param callerDetails Optional caller information (human, agent, or both for A2A). - * @param spanDetails Optional span configuration. + * @param spanDetails Optional span configuration. Defaults the span kind to + * `SpanKind.INTERNAL` when omitted. */ public static start( request: Request, @@ -56,7 +57,7 @@ export class InvokeAgentScope extends OpenTelemetryScope { const resolvedSpanDetails: SpanDetails = { ...spanDetails, - spanKind: spanDetails?.spanKind ?? SpanKind.CLIENT, + spanKind: spanDetails?.spanKind ?? SpanKind.INTERNAL, }; super( diff --git a/test/internal/unit/a365/scopes.test.ts b/test/internal/unit/a365/scopes.test.ts index 4c51f71e..b154e0dd 100644 --- a/test/internal/unit/a365/scopes.test.ts +++ b/test/internal/unit/a365/scopes.test.ts @@ -990,8 +990,8 @@ describe("Scopes", () => { }); it.each([ - ["CLIENT (default)", undefined, SpanKind.CLIENT], - ["SERVER", SpanKind.SERVER, SpanKind.SERVER], + ["INTERNAL (default)", undefined, SpanKind.INTERNAL], + ["SERVER (override)", SpanKind.SERVER, SpanKind.SERVER], ])("InvokeAgentScope spanKind: %s", (_label, input, expected) => { const scope = InvokeAgentScope.start( testRequest, From ed097f57076fd8495c0d95f458e610c40206f84c Mon Sep 17 00:00:00 2001 From: "Nikhil Chitlur Navakiran (from Dev Box)" Date: Mon, 14 Sep 2026 07:29:28 -0600 Subject: [PATCH 2/2] docs: link InvokeAgent span-kind changelog entry Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9ccc29b9-bf5d-4725-be3b-c4276b233c4c --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25fe4e67..212b941b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## [Unreleased] ### Bugs Fixed -- Default `InvokeAgentScope` spans to `SpanKind.INTERNAL` while preserving explicit span-kind overrides. +- Default `InvokeAgentScope` spans to `SpanKind.INTERNAL` while preserving explicit span-kind overrides. [#241](https://github.com/microsoft/opentelemetry-distro-javascript/pull/241) ### Other Changes - Consolidate Dependabot updates for Vitest 4.1.11, Hono 4.13.7, qs 6.16.0, fast-uri 3.1.7, actions/deploy-pages 5.0.1, and actions/checkout 7.0.1.