Skip to content

[Teams Chatbot] Add help or action requests with support contacts - #17453

Open
Jialin Huang (JialinHuang803) wants to merge 10 commits into
mainfrom
jialinhuang/guided-next-steps
Open

Jialin Huang (JialinHuang803) wants to merge 10 commits into
mainfrom
jialinhuang/guided-next-steps

Conversation

@JialinHuang803

@JialinHuang803 Jialin Huang (JialinHuang803) commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds focused clarification and human-help requests to ordinary QA bot answers, backed by repository-owned support contacts.

  • Prefer responsible people identified by current PR details, matching CODEOWNERS, or authoritative guidance; use the support catalog as a fallback.
  • Ask for human input or concrete actions only when needed, with specific questions, context, and links; combine requests for the same person.
  • Resolve GitHub usernames to verified Microsoft identities. Each resolved user provides plain_text for informational contacts and text/mentioned for direct participation requests.
  • Share GitHub username normalization and validation between catalog entries and identity lookups.
  • Forward mention metadata only for Teams channel answers containing the exact verified mention text. Keep catalog names, keys, and metadata out of user-facing answers.
  • Send completed answers as new Teams messages with mention entities, AI/trace metadata, references, and the new message ID recorded in conversation history.

Configuration

  • Support contacts: config/support-contact.yaml defines support areas, descriptions, and individual GitHub usernames. Models, strict YAML validation, and the process-cached loader are in models/support_contact.py. Catalog context is supplied on every turn, including conversation recovery; an empty support_areas list disables catalog-based referrals.
  • Teams mentions: the backend Azure App Configuration key/value ENABLE_TEAMS_MENTION defaults to true. Setting it to false omits mention metadata while preserving the answer, including its <at> text. App Configuration settings are loaded at backend startup, so changes require a backend restart.

The catalog guides the model's contact selection; the backend verifies identity mappings, not expertise or approval authority.

Deployment

Deploy the hosted chat agent and backend with the same users/errors identity-tool result schema, and deploy the frontend for new-message answer delivery.

Relates to Azure/azure-sdk-pr#3149.

Introduce a shared Blob support catalog, model-generated contact targets and validated per-turn routing metadata without confidence assessment dependencies or notification delivery.

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

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
70 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

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

The blob loader bypasses injected candidate settings, and malformed-envelope detection can turn valid legacy answers containing fenced JSON examples into HTTP 500 errors.

2 open issues
What changed in this PR

Adds an opt-in, non-notifying guided-next-step preview to the QA bot, pairing a single model-written answer with support targets grouped by logical contact.

Changes:

  • Adds structured response models and agent instructions for grouped next steps.
  • Loads and caches a shared Blob catalog, injects per-turn snapshots, and validates routing without resolving contact placeholders.
  • Documents rollout compatibility and adds focused validation, recovery, serialization, and mention-behavior tests.
File Description
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​tsp/​models.tsp Defines next-step API metadata.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​tests/​guided_next_step_test.py Tests guided responses, catalog handling, and compatibility.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​services/​support_contact_service.py Loads, validates, and caches the support catalog.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​services/​chat_service.py Injects catalog snapshots and processes structured answers.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​README.md Documents configuration, preview behavior, and rollout.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​models/​guided_next_step.py Defines catalog and response validation rules.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​models/​chat.py Adds optional next-step response metadata.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​config/​support-contact.example.yaml Provides a synthetic catalog template.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​agents/​chat_agent/​next_step.md Guides grouped, non-notifying follow-up generation.
tools/​sdk-ai-bots/​azure-sdk-qa-bot-agent/​agents/​chat_agent/​init.py Loads preview instructions and enables structured output.

Review effort: Balanced

Use ordinary answers and existing verified mentions with a repository-owned support catalog loaded through a cached configuration helper.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JialinHuang803 Jialin Huang (JialinHuang803) changed the title [QA Bot] Add grouped guided-next-step preview [QA Bot] Add optional help requests with repository support contacts Nov 4, 2026
@JialinHuang803 Jialin Huang (JialinHuang803) changed the title [QA Bot] Add optional help requests with repository support contacts [Teams Chatbot] Add optional help requests with repository support contacts Nov 4, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply the approved artifact with scoped support areas, verified GitHub contacts, and consolidated management SDK review and release ownership.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Simplify next-action guidance, prefer concise action sections, address owners directly, and keep informational contacts as plain text. Align tenant and identity-tool guidance with unit coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JialinHuang803 Jialin Huang (JialinHuang803) changed the title [Teams Chatbot] Add optional help requests with repository support contacts [Teams Chatbot] Add help or action requests with support contacts Nov 5, 2026
@@ -1 +1 @@
import { Activity, CardFactory, MessageFactory, TurnContext } from 'botbuilder';

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Will rename this file to ReplyHandler.ts or something like that. Keep it this name so the code can be reiviewed more easily.

Comment on lines +44 to +54
- key: dotnet_management_api_review
description: ".NET management SDK PR and APIView review, including management-library release approval and related generated SDK review. Excludes general .NET core and data-plane issues."
github_username: arthurma1978

- key: dotnet_management_codegen
description: ".NET management SDK code generation, migration and compatibility issues, build failures and release troubleshooting."
github_username: live1206

- key: dotnet_management_pr_review
description: ".NET management SDK PR review, release preparation and generated or custom-code issues."
github_username: arcturuszhang

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

let us use arthurma1978 live1206 and arcturuszhang


- key: apiview_reviewhub_release_gates
description: "APIView and ReviewHub tooling, review-status interpretation and release-gate integration or troubleshooting. Actual API approval belongs to the relevant reviewer."
github_username: tjprescott

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggest to have multiple person if we are able to get the list. Even in the future, there are some changes, we could still find at least one person that could help.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can we make 'github_username' as a list even we only have one person.

Add a next step only when needed to resolve the request; routine instructions do not require an extra request.

- Prefer a human action that can already proceed; ask for missing user facts only when they determine the next action.
- Prefer qualified owners established by current target-specific tools or authoritative guidance, such as requested reviewers or matching `CODEOWNERS`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For spec PR or SDK PR, could the people in the requested reviewers help to solve the real problem? I think we shall prioritize to use the support_contact.

@lru_cache(maxsize=1)
def get_support_catalog() -> SupportContactCatalog | None:
try:
catalog = parse_support_catalog(SUPPORT_CONTACT_PATH.read_bytes())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we made any change to support_contact, how to ensure chatbot could load the latest information? Do we need to rebulid, or restart the chat_agent?

@@ -69,10 +69,34 @@ after reading the PR and its check runs:
Stay within the tool-call budget: diagnosing a PR already requires reading the PR and its check runs; only if needed, add a single `get_file_contents` call to read `CODEOWNERS`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add more integration tests to cover different scenarios.
We could start with the common asks from api-spec-review channel and gradually cover boarder scenarios.

This branch has not been deployed

No deployments
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