Skip to content

feat(a365): port missing tool metadata and tenant-isolated delivery - #276

Merged
Nikhil Navakiran (nikhilNava) merged 2 commits into
mainfrom
feature/a365-dotnet-parity
Oct 30, 2026
Merged

Nikhil Navakiran (nikhilNava) merged 2 commits into
mainfrom
feature/a365-dotnet-parity

Conversation

@nikhilNava

Copy link
Copy Markdown
Collaborator

Summary

Port the four missing or partial portable Agent365 features found by reviewing all 29 closed PRs by nikhilNava in microsoft/opentelemetry-distro-dotnet (28 merged, one unmerged WIP).

The latest merged change, microsoft/opentelemetry-distro-dotnet#179, is already implemented by #265 and is not duplicated here.

Missing features implemented

.NET source PR JavaScript gap before this PR JS-specific implementation
microsoft/opentelemetry-distro-dotnet#170 Full tool endpoint URL was not captured Optional ServiceEndpoint.url records url.full on execute-tool spans, preserving existing host/port behavior and not inventing URLs from host-only endpoints.
microsoft/opentelemetry-distro-dotnet#157 Execute-tool transfer metadata was absent Export TransferMode, TransferTargetType, and a discriminated TransferDetails union. Record explicit mode, target type, and supported target agent properties without replacing source identity. Validate incompatible details before creating a span.
microsoft/opentelemetry-distro-dotnet#158 Durable delivery used one transmission gate across tenants Add leased per-tenant gates shared by live/replay and across agents within a tenant. Continue replay past retryable failures/backed-off tenants, exclude released records within a pass, and bound scanning to 10 times the attempt limit. Registry eviction preserves active leases and unexpired backoff.
microsoft/opentelemetry-distro-dotnet#166 Nested metadata was already collision-safe, but explicit empty metadata was dropped Preserve metadata: {} for explicitly empty extension_data at top-level and nested models; keep absent/null metadata omitted.

No dependencies, publishing workflows, storage record formats, or existing tool call signatures change. The gate registry is internal. Documentation describes URL sensitivity, transfer behavior, tenant isolation, and replay limits.

Remaining reviewed PRs

Audit classification for the other 25 closed PRs
.NET PRs JavaScript disposition
microsoft/opentelemetry-distro-dotnet#179 Unix customer-provisioned storage: already #265.
microsoft/opentelemetry-distro-dotnet#155 Standalone S2S sample: already #244.
microsoft/opentelemetry-distro-dotnet#149 Execute-tool JSON schemas: already #240; the remaining empty-metadata difference is fixed here.
microsoft/opentelemetry-distro-dotnet#137 Retry/durable delivery: already #226; the tenant-isolation follow-up is fixed here.
microsoft/opentelemetry-distro-dotnet#120 Invoke-agent GenAI request/response semantics: already #239.
microsoft/opentelemetry-distro-dotnet#118 Shared service/request attributes: already #243.
microsoft/opentelemetry-distro-dotnet#116 Session propagation/custom baggage: already #242 and #243.
microsoft/opentelemetry-distro-dotnet#112 Duplicate-key formatter fix: JS uses property replacement rather than a throwing dictionary insertion.
microsoft/opentelemetry-distro-dotnet#110 .NET DI-marker mechanism is not applicable; JS supports custom spanProcessors with a365.enableObservabilityExporter: false.
microsoft/opentelemetry-distro-dotnet#109 Guardrail scope: already #157.
microsoft/opentelemetry-distro-dotnet#107 JS intentionally retains its documented/tested last-write-wins recordAttributes() semantics rather than importing .NET DTO protected-attribute filtering.
microsoft/opentelemetry-distro-dotnet#105 OTel message format: already #155.
microsoft/opentelemetry-distro-dotnet#101 Contextual token resolver: already #159.
microsoft/opentelemetry-distro-dotnet#99 GenAI-only processor classification: already implemented in A365SpanProcessor (introduced by #146).
microsoft/opentelemetry-distro-dotnet#95 Telemetry SDK name: already #134.
microsoft/opentelemetry-distro-dotnet#173, microsoft/opentelemetry-distro-dotnet#172, microsoft/opentelemetry-distro-dotnet#165, microsoft/opentelemetry-distro-dotnet#156, microsoft/opentelemetry-distro-dotnet#104 .NET NuGet/assembly organization, contract cleanup, ETW SDK packaging, or .NET dependency decoupling; no equivalent missing JS runtime feature.
microsoft/opentelemetry-distro-dotnet#152, microsoft/opentelemetry-distro-dotnet#127 ETW-only span-kind/status paths; JS manual scopes already support span kind and OTel status without ETW DTOs.
microsoft/opentelemetry-distro-dotnet#115 Microsoft.Extensions.AI/.NET instrumentation source, not a JS instrumentation API.
microsoft/opentelemetry-distro-dotnet#167 .NET CODEOWNERS/process change, not a portable runtime feature.
microsoft/opentelemetry-distro-dotnet#17 Closed unmerged WIP sample, not a shipped feature to port.

Validation

  • Ten affected Agent365 unit suites: 421 passed, 16 skipped (existing/platform-specific skips).
  • Regression cases cover live/replay tenant isolation, same-tenant cross-agent backoff, bounded candidate claims, gate leases/LRU/idle eviction, real-store exclusion and later-tenant delivery, pre-claim exclusion without lease churn, post-claim replacement races, blank-tenant quarantine, failed claim releases, full URLs, transfer validation/source identity, and nested empty metadata.
  • The replay scan budget bounds admitted candidate claims, not directory listings or preflight reads.
  • npm run build, npm run test:esm-build, ESM/CJS root transfer API smoke checks, npm run lint, and npm run format pass. ESLint reports warnings but no errors.
  • TypeDoc generation succeeds with eight warnings; generated output is excluded from this PR.
  • Independent senior review found two storage issues (lease churn and blank-tenant admission); both were reproduced with failing tests, fixed, and re-reviewed with no remaining findings.

Capture complete tool URLs and explicit transfer targets, isolate durable backoff and replay by tenant, and preserve empty nested metadata. Include focused regressions and the JavaScript parity documentation.

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

Copilot-Session: adab09b1-cb4f-4d83-ad92-31d3462610ec

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.

🟡 Changes recommended

Replay can indefinitely starve healthy tenants because older records from a rate-limited tenant repeatedly exhaust each pass’s claim budget without preserving traversal progress.

1 open issue
What changed in this PR

This PR extends Agent365 tool telemetry and durable delivery with portable features from the .NET implementation, without changing existing tool-call signatures or storage formats.

Changes:

  • Add full tool endpoint URLs and typed transfer metadata while preserving source identity.
  • Introduce tenant-specific backoff gates and bounded replay scanning, with stronger record validation.
  • Preserve explicitly empty metadata and add documentation and regression coverage.
File Description
test/​internal/​unit/​a365/​transmissionGateRegistry.test.ts Tests tenant isolation, leases, and eviction.
test/​internal/​unit/​a365/​scopes.test.ts Tests endpoint URLs and transfer attributes.
test/​internal/​unit/​a365/​persistentStore.test.ts Tests exclusions, replacement races, and blank tenants.
test/​internal/​unit/​a365/​messageUtils.test.ts Tests preservation of empty nested metadata.
test/​internal/​unit/​a365/​durableRecord.test.ts Tests rejection of blank tenant identifiers.
test/​internal/​unit/​a365/​durableDeliveryManager.test.ts Tests tenant backoff, replay limits, and release failures.
src/​index.ts Exports public transfer types and enums.
src/​a365/​scopes/​ExecuteToolScope.ts Validates and records transfers and endpoint URLs.
src/​a365/​message-utils.ts Preserves explicitly empty metadata.
src/​a365/​index.ts Exports transfer APIs from Agent365.
src/​a365/​exporter/​durable/​TransmissionGateRegistry.ts Adds leased per-tenant gates with eviction.
src/​a365/​exporter/​durable/​TransmissionGate.ts Exposes pending backoff for eviction protection.
src/​a365/​exporter/​durable/​PersistentStore.ts Skips excluded records before leasing.
src/​a365/​exporter/​durable/​DurableRecord.ts Rejects blank tenant identifiers during parsing.
src/​a365/​exporter/​durable/​DurableDeliveryManager.ts Shares tenant gates across live delivery and bounded replay.
src/​a365/​contracts.ts Defines endpoint URL and transfer contracts.
src/​a365/​constants.ts Adds URL and transfer attribute keys.
CHANGELOG.md Summarizes new features and delivery fixes.
A365_DOCUMENTATION.md Documents transfers, URL sensitivity, metadata, and replay behavior.

Review effort: Balanced

Prevent blocked prefixes larger than the per-pass scan budget from starving later tenants. Preserve post-claim exclusion checks and cover repeated throttling passes, tenant recovery, and claim-time replacement races.

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

Copilot-Session: 19b76a8f-e714-42c6-ac3f-a2905b3f2411
Copilot AI balanced review requested due to automatic review settings October 30, 2026 16:43

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.

🟢 Approval recommended

No active review issues were identified for the Agent365 telemetry and tenant-isolated delivery changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@nikhilNava
Nikhil Navakiran (nikhilNava) merged commit cc998f6 into main Oct 30, 2026
11 checks passed
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.

4 participants