Repository navigation
docs: Squad.Agents.AI + Microsoft Agent Framework integration guide - #1574
Conversation
Adds docs/src/content/docs/guide/agent-framework-integration.md Covers: - SquadAgent : DelegatingAIAgent architecture and client.AsAIAgent() flow - DI registration via AddSquadAgent / AddKeyedSquadAgent - Basic RunAsync and RunStreamingAsync usage - Session/state behavior (no SerializeSessionAsync/DeserializeSessionAsync) - GitHub.Copilot.SDK buildTransitive workaround status (resolved in 0.5.6-rc1) - PermissionHandler.ApproveAll security warning (dev-only) - Aspire dashboard OTel observability with SquadAgentDiagnostics.ActivitySourceName - Container hosting / GITHUB_COPILOT_CLI_PATH guidance - Decision matrix: CLI vs TypeScript SDK vs MAF - Troubleshooting table - Links to all first-party sources + credited Tamir Dresher post/gist Preview banner present. Does not mention non-existent SerializeSessionAsync, DeserializeSessionAsync, or a GitHubCopilotAgent type/static factory. Validated: docs build passes (166 pages indexed). Closes #1565 Working as CAPCOM (SDK Expert) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🛫 PR Readiness Check
PR Scope: 🔧 Infrastructure
|
| Status | Check | Details |
|---|---|---|
| ❌ | Single commit | 3 commits — consider squashing before review |
| ✅ | Not in draft | Ready for review |
| ✅ | Branch up to date | Up to date with dev |
| ❌ | Copilot review | No Copilot review yet — it may still be processing |
| ✅ | Changeset present | No source files changed — changeset not required |
| ✅ | Scope clean | No .squad/ or docs/proposals/ files |
| ✅ | No merge conflicts | No merge conflicts |
| ❌ | Copilot threads resolved | 3 unresolved Copilot thread(s) — fix and resolve before merging |
| ❌ | CI passing | 1 check(s) failing: docs-quality |
Files Changed (1 file, +251 −0)
| File | +/− |
|---|---|
docs/src/content/docs/guide/agent-framework-integration.md |
+251 −0 |
Total: +251 −0
This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.
🟢 Impact Analysis — PR #1574Risk tier: 🟢 LOW 📊 Summary
🎯 Risk Factors
📦 Modules Affecteddocs (1 file)
This report is generated automatically for every PR. See #733 for details. |
There was a problem hiding this comment.
Pull request overview
Adds a new docs guide describing how to integrate Squad.Agents.AI with Microsoft Agent Framework (MAF) so a Squad team can be used as a .NET AIAgent, including DI registration, invocation, observability (Aspire/OpenTelemetry), security considerations, hosting notes, troubleshooting, and reference links.
Changes:
- New MAF integration guide page under
docs/src/content/docs/guide/. - Documents install + transitive
GitHub.Copilot.SDKworkaround context and upgrade guidance. - Includes DI, invocation (sync + streaming), and Aspire tracing wiring examples.
Show a summary per file
| File | Description |
|---|---|
| docs/src/content/docs/guide/agent-framework-integration.md | New integration guide for Squad.Agents.AI + MAF, including install/DI/examples/observability/security/troubleshooting. |
Review details
Suppressed comments (2)
docs/src/content/docs/guide/agent-framework-integration.md:236
0.5.6-rc1+isn’t a valid NuGet package version (the+suffix is not a usable “or newer” notation). Use explicit wording like “0.5.6-rc1 or later” instead.
| `InvalidOperationException: Copilot runtime not found` | Native CLI binary not in output; old package version | Upgrade to `Squad.Agents.AI 0.5.6-rc1+`; if still failing, add direct `GitHub.Copilot.SDK` reference |
docs/src/content/docs/guide/agent-framework-integration.md:127
- The streaming snippet has the same issue as the non-streaming example:
hostisn’t defined, so the snippet won’t compile if copied as-is. Make it standalone (or explicitly reference the earlier snippet) so it’s usable.
```csharp
var squad = host.Services.GetRequiredService<SquadAgent>();
var session = await squad.CreateSessionAsync();
await foreach (var update in squad.RunStreamingAsync("Summarize the team.", session))
{
Console.Write(update.Text);
}
Console.WriteLine();
</details>
- **Files reviewed:** 1/1 changed files
- **Comments generated:** 4
- **Review effort level:** Lite
| > ⚠️ **`PermissionHandler.ApproveAll` is for local dev and fully-trusted automated pipelines only.** | ||
| > | ||
| > `SquadAgent` sets `OnPermissionRequest = PermissionHandler.ApproveAll` on the `SessionConfig` by default. This silently approves every permission request — shell access, file reads, URL fetches — without review. **Do not use this in public-facing or multi-tenant server deployments.** | ||
|
|
| ```xml | ||
| <PackageReference Include="GitHub.Copilot.SDK" Version="*-*" /> | ||
| ``` |
| ```csharp | ||
| builder.Services.AddSquadAgent(ServiceLifetime.Singleton, o => { ... }); | ||
| ``` |
| ```csharp | ||
| using Microsoft.Agents.AI; | ||
|
|
||
| var squad = host.Services.GetRequiredService<AIAgent>(); | ||
| var session = await squad.CreateSessionAsync(); | ||
| var response = await squad.RunAsync("What can this team do?", session); | ||
| Console.WriteLine(response.Text); | ||
| ``` |
…ionResult, fix ref link Revision by Handbook after FIDO rejection of CAPCOM's PR #1574. Fixes: - Add page-local cspell:ignore for 'nupkgs' and 'devblogs' (avoids editing shared global config; docs-quality check now passes: 0 issues in 0 files) - Remove scoped-handler code block using PermissionKind.Shell/File and PermissionResult.Deny/Allow — these type names are not present in the GitHub.Copilot.SDK 1.0.x XML docs; the actual return type is PermissionDecision (GitHub.Copilot.Rpc). Replace with accurate prose describing the delegate pattern plus a link to the first-party SDK permission-handler reference. PermissionHandler.ApproveAll warning retained (verified in SquadAgent.cs line 132 and SDK XML). - Make microsoft/agent-framework#6457 entry in References table a clickable link to microsoft/agent-framework#6457 Verified retained content: - 0.5.6-rc1 version: confirmed in Squad.Agents.AI.csproj <Version>0.5.6-rc1</Version> - buildTransitive bridge: confirmed in .csproj lines 48, 67, 101, 132 Docs build: 166 pages indexed (unchanged). CSpell: 0 issues. Closes #1565 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…var, fix streaming snippet - Replace `0.5.6-rc1+` with plain-English 'version 0.5.6-rc1 or later' in troubleshooting table (NuGet + suffix is not a valid 'or newer' operator) - Remove fabricated `GITHUB_COPILOT_CLI_PATH` env var; document verified `SquadAgentOptions.CliPath` DI-time property (source: SquadAgentOptions.cs:28, SquadAgent.cs:298-300) with minimal example showing how Squad passes it to RuntimeConnection.ForStdio at startup - Add '// Assumes host is the IHost built in the DI registration step above.' comment to streaming snippet so `host` is explicitly referenced without making the snippet standalone Verified: docs build 166 pages, cspell 0 issues. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Adds the missing MAF integration guide at
docs/src/content/docs/guide/agent-framework-integration.md.Closes #1565
CONTROL revision notes (post-Handbook/FIDO cycle)
Three factual corrections applied — all grounded in source evidence:
1.
0.5.6-rc1+→ plain English in troubleshooting tableProblem: The troubleshooting table used
Squad.Agents.AI 0.5.6-rc1+as if+is a NuGet "or newer" operator. It is not — NuGet does not recognize+as a range operator; it is used only in build metadata (SemVer 2.0) and is ignored or rejected by the package manager.Fix: Changed to
Squad.Agents.AI version 0.5.6-rc1 or later(plain English, no version literal syntax).Evidence: Copilot reviewer comment on line 236; NuGet SemVer spec.
2. Fabricated
GITHUB_COPILOT_CLI_PATHenv var removed;SquadAgentOptions.CliPathdocumentedProblem: The Hosting section stated "Set the
GITHUB_COPILOT_CLI_PATHenvironment variable to the CLI binary path". No such environment variable exists in the source code or the GitHub.Copilot SDK.Source evidence:
src/Squad.Agents.AI/SquadAgentOptions.cs:28—public string? CliPath { get; set; }src/Squad.Agents.AI/SquadAgent.cs:298-300—if (!string.IsNullOrEmpty(options.CliPath) || combinedCliArgs.Count > 0) { clientOptions.Connection = RuntimeConnection.ForStdio(options.CliPath, combinedCliArgs); }Fix: Removed
GITHUB_COPILOT_CLI_PATHentirely. Replaced with accurate prose describingSquadAgentOptions.CliPathas a DI-time property, with a minimal compilable example:3. Streaming snippet made self-contained
Problem: The streaming snippet used
hostwithout defining it, making it non-compilable if copied in isolation.Fix: Added a single comment:
// Assumes host is the IHost built in the DI registration step above.This explicitly cross-references the preceding host setup without duplicating the full build boilerplate.Verified retained content
Squad.Agents.AIversion is0.5.6-rc1<Version>0.5.6-rc1</Version>insrc/Squad.Agents.AI/Squad.Agents.AI.csprojline 31buildTransitivebridge ships in that packagePackagePath="buildTransitive\Squad.Agents.AI.props"in csproj item groupPermissionHandler.ApproveAllis set by defaultSquadAgent.csline 132SquadAgentOptions.CliPathis the correct DI-time propertySquadAgentOptions.cs:28,SquadAgent.cs:298-300agent-framework-integration.mdtouchedValidation
<!-- cspell:ignore nupkgs devblogs -->directive preserved (not in global cspell.json)