fix: resolve Google ADK agent Playground and production issues - #263
Merged
Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Fix AUTH_HANDLER_NAME env-driven pattern — empty = anonymous/Playground, AGENTIC = production - Fix expired BEARER_TOKEN detection via JWT exp claim to prevent OBO hang - Skip MCP tool init when no token and no auth handler (avoids MCP session errors) - Add 10s timeout on MCP tool initialization with graceful fallback to bare LLM - Fix AgentAuthConfiguration construction (typed object not plain dict) for JWT middleware - Read PORT from env for Azure/GCP compatibility (default 3978 for local dev) - Read GEMINI_MODEL from env (default gemini-2.5-flash, replaces deprecated gemini-2.0-flash) - Fix instruction dropped when rebuilding Agent with MCP tools - Add getattr fallback for recipient.tenant_id/agentic_user_id (Playground sends minimal activity) - Add typing indicator loop and immediate ack message in message handler - Add .gitignore for A365 deploy artifacts and manifest folder - Update .env.template with all keys, placeholders, port guidance and needDeployment notes - Update README with local dev, Agents Playground, Azure/GCP deploy, publish lifecycle and troubleshooting
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuesnodejs/claude/sample-agent/package.json
nodejs/langchain/sample-agent/package.json
nodejs/openai/sample-agent/package.json
nodejs/vercel-sdk/sample-agent/package.json
OpenSSF ScorecardScorecard details
Scanned Files
|
Pujarini Mohapatra (biswapm)
requested review from
ajmfehr,
Grant Harris (gwharris7) and
Sellakumaran Kanagarathnam (sellakumaran)
April 1, 2026 10:53
Copilot started reviewing on behalf of
Pujarini Mohapatra (biswapm)
April 1, 2026 10:55
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Updates multiple Agent 365 samples (primarily the Python Google ADK sample) to behave correctly in Agents Playground vs production, improve MCP/tool initialization robustness, and refresh documentation/config templates for local + cloud hosting.
Changes:
- Fix Google ADK sample auth/tooling flow (env-driven auth handler selection, skip/timeout MCP init, BEARER_TOKEN expiry handling, preserve agent instructions when rebuilding with tools).
- Improve runtime/config ergonomics (PORT/LOG_LEVEL/GEMINI_MODEL via env, typed JWT middleware configuration, recipient fallbacks, typing/ack UX).
- Documentation & sample maintenance updates (expanded README/.env.template/.gitignore; Python version caps and Windows dependency caps; remove synthetic observability IDs in Node samples).
Reviewed changes
Copilot reviewed 7 out of 9 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| python/google-adk/sample-agent/README.md | Major rewrite: local dev, Playground, deployment, config reference, troubleshooting. |
| python/google-adk/sample-agent/main.py | Env-driven logging/observability, typed JWT config, PORT support. |
| python/google-adk/sample-agent/hosting.py | AUTH_HANDLER_NAME-driven auth enforcement and message/notification handler wiring. |
| python/google-adk/sample-agent/agent.py | GEMINI_MODEL env default, MCP init timeout/skip logic, recipient fallbacks, BEARER_TOKEN expiry check. |
| python/google-adk/sample-agent/mcp_tool_registration_service.py | Preserve instruction when reconstructing ADK agent with MCP tools. |
| python/google-adk/sample-agent/.env.template | Expanded template with placeholders, auth/tooling, server + observability settings. |
| python/google-adk/sample-agent/.gitignore | Ignore deploy artifacts, venvs, and local secrets for this sample. |
| python/crewai/sample_agent/README.md | Tighten documented supported Python versions. |
| python/crewai/sample_agent/pyproject.toml | Constrain Python versions and cap lancedb on Windows (plus uv override). |
| nodejs/vercel-sdk/sample-agent/src/client.ts | Remove synthetic response-id recording in observability scope. |
| nodejs/openai/sample-agent/src/client.ts | Remove synthetic response-id recording in observability scope. |
| nodejs/openai/sample-agent/src/agent.ts | Remove hardcoded synthetic correlationId. |
| nodejs/langchain/sample-agent/src/client.ts | Remove synthetic response-id recording in observability scope. |
| nodejs/langchain/sample-agent/src/agent.ts | Remove synthetic correlationId generation. |
| nodejs/claude/sample-agent/src/client.ts | Remove synthetic response-id recording in observability scope. |
| nodejs/claude/sample-agent/src/agent.ts | Remove hardcoded synthetic correlationId. |
| .gitignore | Ignore A365 deploy artifacts repo-wide. |
…ost binding, JWT parsing, env template Agent-Logs-Url: https://github.com/microsoft/Agent365-Samples/sessions/a8694946-d298-4af8-b7a5-bbf06db84366 Co-authored-by: biswapm <29349597+biswapm@users.noreply.github.com>
added 2 commits
April 1, 2026 18:56
Grant Harris (gwharris7)
previously approved these changes
Apr 1, 2026
added 2 commits
April 2, 2026 16:26
Grant Harris (gwharris7)
previously approved these changes
Apr 3, 2026
added 2 commits
April 6, 2026 10:52
…gent365-Samples into fix/google-adk-agent # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
ajmfehr
approved these changes
Apr 6, 2026
Grant Harris (gwharris7)
approved these changes
Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
main.py,agent.py, andmcp_tool_registration_service.pyto use standard# Copyright (c) Microsoft Corporation. / # Licensed under the MIT License.formatload_configuration_from_envimport frommain.py0.0.0.0for Azure (WEBSITE_SITE_NAME), GCP Cloud Run (K_SERVICE), or explicitENVIRONMENT=production; defaults tolocalhostfor local devexpparsing to useurlsafe_b64decodeand only add padding whenlen(payload) % 4 != 0USE_AGENTIC_AUTHfrom.env.template(unused variable not referenced in code)