Skip to content
GitHub Copilot Train-the-Trainer
Overview

Session M6-01: Build reliable agent applications with the GitHub Copilot SDK

Module: Module 6: Advanced Topics & Capstone

Difficulty: Advanced

Prerequisites: Sessions M1-01 to M1-03, M2-01 to M2-04, M3-01 to M3-05

Duration: 3 hours (1 hour trainer content, 2 hour lab)

SDK version: @github/copilot-sdk 1.0.16, pinned in the starter and solution

Overview

Build a TypeScript CLI around an agent to assess whether a synthetic software change is ready to proceed.

You write the reliability controls in application code. The CLI manages the client and session lifecycle, streams progress, and limits tool use. It also shows denied actions, records failures, and closes resources. Tests check that control path. An optional extension sends traces through an OpenTelemetry Collector to Jaeger.

Learning outcomes

  • manage CopilotClient and session startup, use, and shutdown;
  • subscribe to streaming session events without printing duplicate final output;
  • define a typed custom tool over deterministic synthetic data;
  • separate tool availability, permission handling, and pre-tool policy;
  • use pre-tool, failed-tool, error, and session-end hooks;
  • make a denied action visible to the user and trace;
  • test the allowed, denied, failed, and cleanup paths;
  • tell what the SDK provides from what the sample app chooses;
  • (optional) send SDK traces through an OpenTelemetry Collector to Jaeger.

Required access

Learners need authenticated GitHub Copilot SDK access, Node.js and npm, and a terminal. The optional tracing extension also needs Docker with Docker Compose.

Scenario

The application is a change readiness assistant. It reads deterministic synthetic change records, asks Copilot to assess the selected change, and returns ready or needs-review with the supporting gaps.

One request targets a restricted synthetic record. The application denies that lookup before execution and shows the reason.

Session structure

Block Duration Content
Trainer content 60 min Slides, concepts, and prepared demo
Lab 120 min Build and check the CLI

Materials

Resource Location
Trainer guide trainer-content/README.md
Slides slides.md
Lab guide lab/README.md
Starter project lab/starter/sdk-readiness-assistant/
Reference solution lab/solution/sdk-readiness-assistant/

Scope

The lab covers:

  • local CopilotClient and session lifecycle;
  • TypeScript streaming event handlers;
  • one application-owned readiness tool;
  • recorded permission decisions;
  • pre-tool, post-tool-failure, error, and session-end hooks;
  • a visible denied action;
  • focused automated tests;
  • optional extension: OTLP export through an OpenTelemetry Collector and trace inspection in Jaeger.

The session doesn't cover dynamic workflows, fleet, cloud or remote sessions, BYOK, plugin packaging, production deployment, external business systems, or other languages.

Product references

The GitHub Copilot SDK became generally available on June 2, 2026.