Skip to content

Remove TextCompletion and GenerateContent from InferenceOperationType and GEN_AI_OPERATION_NAMES#242

Open
Copilot wants to merge 2 commits intomainfrom
copilot/remove-text-completion-generate-content
Open

Remove TextCompletion and GenerateContent from InferenceOperationType and GEN_AI_OPERATION_NAMES#242
Copilot wants to merge 2 commits intomainfrom
copilot/remove-text-completion-generate-content

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 27, 2026

InferenceOperationType carried two legacy genAI operation values (TextCompletion, GenerateContent) that are no longer emitted by the SDK. These were also present in the GEN_AI_OPERATION_NAMES allowlist used by partitionByIdentity to filter exportable spans.

Changes

  • contracts.ts — Drops TEXT_COMPLETION and GENERATE_CONTENT from InferenceOperationType; enum now contains only CHAT.
  • exporter/utils.ts — Removes 'TextCompletion' and 'GenerateContent' from the GEN_AI_OPERATION_NAMES allowlist.
  • scopes.test.ts — Updates the one test using InferenceOperationType.TEXT_COMPLETION to use InferenceOperationType.CHAT.
  • docs/design.md — Reflects the reduced enum.
// Before
export enum InferenceOperationType {
  CHAT = 'Chat',
  TEXT_COMPLETION = 'TextCompletion',   // removed
  GENERATE_CONTENT = 'GenerateContent'  // removed
}

// After
export enum InferenceOperationType {
  CHAT = 'Chat'
}
Original prompt

Create a PR in microsoft/Agent365-nodejs to remove the two genAI operation name strings TextCompletion and GenerateContent from the codebase.

Requirements:

  • Search the whole repository for occurrences of these exact string literals (and any related usage that would break after removal):
    • 'TextCompletion' (commented as // InferenceOperationType.TEXT_COMPLETION)
    • 'GenerateContent' (commented as // InferenceOperationType.GENERATE_CONTENT)
  • Remove them from any lists/sets/allowlists of genAI operation names (e.g., GEN_AI_OPERATION_NAMES in packages/agents-a365-observability/src/tracing/exporter/utils.ts).
  • Ensure any logic that relied on these values is still correct, and update tests accordingly.
  • Run formatting/lint/tests as appropriate for the repo.

Repository-specific review rules:

  • Ensure no occurrences of keyword Kairo remain in any .js, .ts, .jsx, .tsx files touched; if found, remove/replace appropriately.
  • Ensure all modified or new .js/.ts/.jsx/.tsx files contain the Microsoft MIT header at the top:
    // Copyright (c) Microsoft Corporation.
    // Licensed under the MIT License.
    followed by a blank line.

Notes:

  • The user specifically wants these two values removed "from the whole repos".

Context:

  • Known location with these strings: packages/agents-a365-observability/src/tracing/exporter/utils.ts.
  • The file already has the correct header; preserve it.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: create a PR remove from 'TextCompletion', // InferenceOperationType.TEXT_COMPLETION
'GenerateContent', // InferenceOperationType.GENERATE_CONTENT from the whole repos

Assistant: I’m waiting for your confirmation in the pending prompt so I can proceed with creating the pull request and applying the repo-wide removals.

This pull request was created from Copilot chat.

… and GEN_AI_OPERATION_NAMES

Agent-Logs-Url: https://github.com/microsoft/Agent365-nodejs/sessions/3acaba0f-3822-468d-b962-cf8531c7be53

Co-authored-by: fpfp100 <126631706+fpfp100@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove genAI operation name strings TextCompletion and GenerateContent Remove TextCompletion and GenerateContent from InferenceOperationType and GEN_AI_OPERATION_NAMES Apr 27, 2026
Copilot AI requested a review from fpfp100 April 27, 2026 20:49
@fpfp100 fpfp100 marked this pull request as ready for review April 27, 2026 20:50
@fpfp100 fpfp100 requested a review from a team as a code owner April 27, 2026 20:50
Copilot AI review requested due to automatic review settings April 27, 2026 20:50
Copy link
Copy Markdown

@juliomenendez juliomenendez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this change going to break usage of older Semantic Kernel versions?

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