Skip to content

feat: enable a365 sample runnable in ATK agents playground#236

Open
HuihuiWu-Microsoft wants to merge 6 commits intomicrosoft:mainfrom
HuihuiWu-Microsoft:huihui/enable-playground-in-atk
Open

feat: enable a365 sample runnable in ATK agents playground#236
HuihuiWu-Microsoft wants to merge 6 commits intomicrosoft:mainfrom
HuihuiWu-Microsoft:huihui/enable-playground-in-atk

Conversation

@HuihuiWu-Microsoft
Copy link

No description provided.

@HuihuiWu-Microsoft HuihuiWu-Microsoft requested a review from a team as a code owner March 10, 2026 02:44
Copilot AI review requested due to automatic review settings March 10, 2026 02:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Node.js LangChain sample agent to support debugging/running directly in Microsoft 365 Agents Playground via TeamsFx tooling, adding the required configuration, VS Code tasks, and environment templates.

Changes:

  • Add TeamsFx/M365 Agents Playground project YAMLs and VS Code debug/task wiring for one-key launch.
  • Introduce Playground-specific environment files and a PowerShell helper to refresh bearer tokens via the A365 CLI.
  • Update package.json scripts/dev workflow to support TeamsFx-based Playground launch.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
nodejs/langchain/sample-agent/README.md Updates prerequisites and adds step-by-step Playground debugging instructions.
nodejs/langchain/sample-agent/package.json Adjusts dev script for inspector + adds TeamsFx/Playground helper scripts and env-cmd.
nodejs/langchain/sample-agent/m365agents.yml Adds base TeamsFx/M365 Agents Toolkit YAML configuration.
nodejs/langchain/sample-agent/m365agents.playground.yml Adds Playground deployment steps and env file materialization.
nodejs/langchain/sample-agent/env/.env.playground.user Adds user-specific secret placeholders for Playground.
nodejs/langchain/sample-agent/env/.env.playground Adds committed Playground env settings (ports, app id, agentic auth settings).
nodejs/langchain/sample-agent/.vscode/tasks.json Adds TeamsFx deploy + local start + Playground start tasks and token refresh step.
nodejs/langchain/sample-agent/.vscode/scripts/refresh-bearer-token.ps1 Adds script to acquire/update bearer token via a365 develop get-token.
nodejs/langchain/sample-agent/.vscode/launch.json Adds attach config + compound launch for Playground debugging.
nodejs/langchain/sample-agent/.vscode/extensions.json Recommends Teams Toolkit extension.
nodejs/langchain/sample-agent/.gitignore Adds ignore rules for TeamsFx local files/dev tools.

Comment on lines +64 to +66
"options": {
"cwd": "${workspaceFolder}",
},
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

tasks.json is not valid JSON because there is a trailing comma after the cwd property in the options object. VS Code will fail to load tasks from this file until the trailing comma is removed.

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +43
"label": "Refresh bearer token (Microsoft 365 Agents Playground)",
"type": "shell",
"command": "powershell",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-File",
"${workspaceFolder}/.vscode/scripts/refresh-bearer-token.ps1"
],
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This task hard-codes powershell as the command, which will fail on macOS/Linux by default. Consider using pwsh (PowerShell 7) with OS-specific overrides, or gating this task to Windows and documenting an alternative token refresh path for non-Windows devs.

Copilot uses AI. Check for mistakes.
Comment on lines +88 to +92
"options": {
"env": {
"PATH": "${workspaceFolder}/devTools/playground/node_modules/.bin;${env:PATH}"
}
},
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

PATH is being concatenated using ;, which is Windows-specific. Because this options.env block applies to all platforms, it will break PATH resolution on macOS/Linux (they use :). Use OS-specific windows/linux/osx overrides (or a platform-agnostic approach) so the task works cross-platform.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +7
# Option 1: Azure OpenAI (preferred for enterprise)
SECRET_AZURE_OPENAI_API_KEY=
AZURE_OPENAI_ENDPOINT=
AZURE_OPENAI_DEPLOYMENT_NAME=

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This file is tracked in git but is named like a user-secret env file (.env.*.user) and contains secret placeholders (SECRET_*). Since the repo’s .gitignore is set up to ignore env/.env.*.user, it’s safer to keep this untracked and instead commit a template (e.g., env/.env.playground.user.example) to reduce the risk of accidentally committing real tokens later.

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
# This file includes environment variables that can be committed to git. It's gitignored by default because it represents your local development environment.

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The header comment says this env file is "gitignored by default", but the repo’s .gitignore does not ignore env/.env.playground (and this PR is committing it). Either update the comment to reflect that it’s committed as a template, or update .gitignore if it should remain local-only.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +9
# Environment variables used by Microsoft 365 Agents Playground
TEAMSAPPTESTER_PORT=56150
TEAMSFX_NOTIFICATION_STORE_FILENAME=.notification.testtoolstore.json

Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

TEAMSFX_NOTIFICATION_STORE_FILENAME is set to .notification.testtoolstore.json, but .gitignore only ignores .notification.localstore.json / .notification.playgroundstore.json. This likely creates an unignored local state file that could be accidentally committed. Either change the filename to match an ignored pattern or add this filename to .gitignore.

Copilot uses AI. Check for mistakes.
Comment on lines +5 to +7
.localConfigs
.localConfigs.playground
.localConfigs
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

.gitignore has a duplicate .localConfigs entry. Consider removing the duplicate to keep the ignore list clean and avoid confusion when updating it later.

Copilot uses AI. Check for mistakes.
Comment on lines +8 to +10
.notification.localstore.json
.notification.playgroundstore.json
appPackage/build
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

.env.playground sets TEAMSFX_NOTIFICATION_STORE_FILENAME to .notification.testtoolstore.json, but this filename is not ignored here (only .notification.localstore.json / .notification.playgroundstore.json are). Add .notification.testtoolstore.json (or a wildcard pattern) to prevent accidentally committing local notification store state.

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +21
> - [Microsoft 365 Agents Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) latest version
> - Prepare your own Azure/openAI API credentials
> - Azure CLI signed in with `az login`
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

Spelling/capitalization: "Azure/openAI" should be "Azure/OpenAI" to match standard product naming used elsewhere in the repo.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to +18
## Prerequisites
>
> To run the template in your local dev machine, you will need:
>
> - [Node.js](https://nodejs.org/), supported versions: 18.x or higher
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

The prerequisites list is formatted as a blockquote (>), which is inconsistent with other Node.js sample READMEs (e.g., nodejs/openai/sample-agent/README.md and nodejs/claude/sample-agent/README.md use a normal bullet list). Consider removing the blockquote markers so the section renders consistently across samples.

Copilot uses AI. Check for mistakes.
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.

3 participants