Skip to content

Add Copilot SDK integration guide and Node.js sample#417

Merged
metang merged 9 commits intomicrosoft:mainfrom
thegovind:main
Feb 6, 2026
Merged

Add Copilot SDK integration guide and Node.js sample#417
metang merged 9 commits intomicrosoft:mainfrom
thegovind:main

Conversation

@thegovind
Copy link
Contributor

Summary

  • Add docs/copilot-sdk-integration.md — guide for using GitHub Copilot SDK with Foundry Local for agentic workflows (tool calling, planning, multi-turn) via BYOK
  • Add samples/js/copilot-sdk-foundry-local/ — working Node.js sample demonstrating the BYOK pattern (Foundry Local SDK for lifecycle, OpenAI client for inference)
  • Update docs/README.md with new Integration Guides section

Context

This is part of a cross-repo effort:

  • github/copilot-sdk: Companion PR adds Foundry Local to the public BYOK provider docs

What's New

Integration Guide (docs/copilot-sdk-integration.md)

  • Architecture overview (App → Copilot SDK → Foundry Local → Local Model)
  • Quick start for Node.js/TypeScript and Python
  • "When to use which approach" comparison table
  • Limitations and related links

Node.js Sample (samples/js/copilot-sdk-foundry-local/)

  • Bootstraps Foundry Local via SDK
  • Creates OpenAI-compatible client (same pattern Copilot SDK uses with BYOK type "openai")
  • Streams a chat completion from a local model
  • Follows existing hello-foundry-local sample patterns (copyright header, project structure)

Validation

  • All 54 existing SDK unit tests pass (sdk/js vitest suite)
  • node --check passes on src/app.js
  • package.json validates as correct JSON
  • No existing source code modified — only new files + docs/README.md update

thegovind and others added 3 commits February 6, 2026 05:25
Add documentation showing how to use GitHub Copilot SDK with Foundry Local for agentic workflows (tool calling, planning, multi-turn) via BYOK configuration. Update docs/README.md with Integration Guides section.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Working Node.js sample demonstrating the BYOK pattern: Foundry Local SDK for service/model lifecycle, OpenAI client for inference. Includes package.json, README with setup instructions, and streaming chat completion example.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Add Copilot SDK integration guide and Node.js sample
@vercel
Copy link

vercel bot commented Feb 6, 2026

@thegovind is attempting to deploy a commit to the MSFT-AIP Team on Vercel.

A member of the Team first needs to authorize it.

…Local

Replace the OpenAI client wrapper with actual @github/copilot-sdk usage:
- Use CopilotClient, createSession, defineTool from @github/copilot-sdk
- Configure BYOK provider with type 'openai' pointing to Foundry Local
- Add custom tool (get_system_info) demonstrating agentic capabilities
- Add streaming event handling and multi-turn conversation
- Switch from JS to TypeScript (matching Copilot SDK cookbook pattern)
- Add Copilot CLI as prerequisite in README and integration guide
- Rewrite integration guide with real API examples (Node.js + Python)
thegovind added a commit to thegovind/copilot-sdk that referenced this pull request Feb 6, 2026
Use manager.endpoint instead of hardcoded URL, add wireApi: completions,
and link to the full integration guide and working sample in the
Foundry-Local repo (microsoft/Foundry-Local#417).
- gpt-oss-20b outputs internal reasoning tokens that break Copilot SDK
- phi-4-mini works cleanly with BYOK + streaming + multi-turn
- Add zod dependency for typed tool parameters
- Rewrite app.ts with custom sendMessage helper to handle Foundry Local
  streaming quirk (missing finish_reason)
- Update integration guide and sample README
@vercel
Copy link

vercel bot commented Feb 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
foundry-local Ready Ready Preview, Comment Feb 6, 2026 8:30pm

Request Review

@metang metang merged commit 25b21bc into microsoft:main Feb 6, 2026
2 checks passed
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.

2 participants