Skip to content

.NET: Correct sample READMEs about missing environment variables - #9732

Draft
Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/dotnet-readme-missing-env-behavior
Draft

Naveen Chatlapalli (1aifanatic) wants to merge 1 commit into
microsoft:mainfrom
1aifanatic:contrib/dotnet-readme-missing-env-behavior

Conversation

@1aifanatic

Copy link
Copy Markdown
Contributor

Motivation & Context

Six .NET sample READMEs end their environment variable setup with "If the variables are not set, you will be prompted for the values when running the samples." None of these samples prompt. Each reads its settings with GetEnvironmentVariable(...) ?? throw new InvalidOperationException(...) and stops. The only Console.ReadLine calls in these folders are for chat input and tool approvals.

Description & Review Guide

  • What are the major changes? Replace the sentence with "If a required variable is not set, the sample stops with an error that names the missing variable." in:
    • 02-agents/Agents/README.md
    • 02-agents/A2A/README.md
    • 02-agents/AgentProviders/README.md
    • 02-agents/AgentProviders/anthropic/README.md
    • 02-agents/ModelContextProtocol/README.md
    • 02-agents/AgentWithRAG/AgentWithRAG_Step02_CustomVectorStoreRAG/README.md
  • What is the impact of these changes? Documentation only.
  • What do you want reviewers to focus on? Nothing special.

I checked that every throw on a missing variable in these folders names the variable (for example FOUNDRY_PROJECT_ENDPOINT is not set., Please set the GOOGLE_GENAI_API_KEY environment variable.). The ModelContextProtocol edit is 10 lines below the line #9581 changes, so the two do not conflict.

Related Issue

N/A - trivial change: the READMEs describe a prompt that the samples do not implement, and the actual behavior is unambiguous from the code.

AI Assistance

  • No material AI assistance was used.
  • This is an AI-assisted contribution. I reviewed, understood, and verified all submitted content and accept responsibility for it.

AI assistance details: Claude Code helped compare the README claims with the samples' code, make the edits, and draft this description.

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR links to an agreed issue with no competing open PR, or the Related Issue section documents a trivial-change or repository-automation exception.
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

🤖 Generated with Claude Code

Six READMEs said the samples prompt for unset environment variables. None
of them do: every sample reads its settings with
GetEnvironmentVariable(...) ?? throw and stops with an error naming the
missing variable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 26, 2026 18:36
@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Oct 26, 2026

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

The six documentation-only corrections match the reported sample validation behavior, with no unresolved findings.

No open issues 🎉

What changed in this PR

Corrects six .NET sample READMEs to describe existing behavior when required environment variables are missing.

Changes:

  • Removes incorrect claims that samples prompt for missing values.
  • Clarifies that samples stop with an error naming the missing variable.
  • Changes documentation only; runtime behavior is unchanged.
File Description
dotnet/​samples/​02-agents/​ModelContextProtocol/​README.md Corrects missing-variable guidance for MCP samples.
dotnet/​samples/​02-agents/​AgentWithRAG/​AgentWithRAG_Step02_CustomVectorStoreRAG/​README.md Corrects missing-variable guidance for custom vector-store RAG.
dotnet/​samples/​02-agents/​Agents/​README.md Corrects missing-variable guidance for agent samples.
dotnet/​samples/​02-agents/​AgentProviders/​README.md Corrects shared provider setup guidance.
dotnet/​samples/​02-agents/​AgentProviders/​anthropic/​README.md Corrects missing-variable guidance for Anthropic samples.
dotnet/​samples/​02-agents/​A2A/​README.md Corrects missing-variable guidance for A2A samples.

Review effort: Balanced

This branch was previously deployed

1 inactive deployment
github-app-auth — 3440a961 Deployed Oct 26, 2026 by 1aifanatic via team_check #7571
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants