All notable changes to the Copilot SDK are documented in this file.
This changelog is automatically generated by an AI agent when stable releases are published. See GitHub Releases for the full list.
Fix release. The Erlang and Elixir SDKs now complete the handshake with a real Copilot CLI (they never could before), and install instructions are corrected across the SDK READMEs. No API changes in the other 38 SDKs.
Content-Length framing like the Node.js reader, stderr kept out of the JSON-RPC stream, and executable paths with spaces.permission.requested events are answered with session.permissions.handlePendingPermissionRequest, and requestPermission is sent when on_permission_request is set. copilot_types:permission_result/1 returns the protocol 4 kinds (approved and denied still work as aliases).on_exit_plan_mode_request option, routed per session. The old exit plan mode handler crashed on a missing function.JsonRpcClient now opens and owns the Copilot CLI port, so the first request no longer hangs. A CLI exit, timeout, or stopped client returns an error tuple, and auto_start starts a new CLI on the next call.{:copilot_sdk_supercharged, "~> 3.1"} (the old "~> 2.0" pin resolved to 2.x), D uses a dub.json path dependency on copilot-sdk, Tcl loads copilot::client, and V and the Solidity helpers install from source (neither is in a registry yet).com.github.copilot API (it imported com.github.copilot.sdk.*, which doesn't exist) and pins the current version; all 23 Java blocks compile against the published jar.copilot-sdk-supercharged = "3.1" (it said "0.1"); all 31 Rust blocks build.scripts/verify-sdk-coverage.mjs on every pull request and push to main, so a parity gap now fails CI instead of waiting for a manual check.Upstream sync: 2 snapshot commits from github/copilot-sdk (Microsoft Copilot SDK 2.0.2-preview.7 and 2.0.3-preview.0). The new public APIs are ported to all 40 SDKs, and existing handlers compile unchanged.
mcp.secrets.save stores a legacy MCP configuration credential and reports whether the OS keychain accepted it (usedKeychain), mcp.secrets.delete removes one secret, and mcp.secrets.deleteServer removes every credential indexed for a legacy MCP server. Each accepts an optional configDir.permissions.extensionApprovals.grant persists the approval for a live extension permission request before the host answers it, list returns persisted approvals (extensionName, pluginName, capabilities, grantedAt, installationKey, and an optional installationLabel) for the server profile or an attached session, and revoke removes one installation's approval.imageAttachmentConstraints (allowedMimeTypes, maxBytesPerImage, maxCount) when the runtime accepts images, and responses can include base64 image attachments (type, data, mimeType, and optional description and displayName). For an image-only answer, send an empty answer with wasFreeform set to true. In Rust, Haskell, and Ada, image answers use a separate response type and handler option so existing text-only handlers compile unchanged; the COBOL SDK's 4,096-byte reply buffer limits it to small images.userInput.request to their existing handler. Before this release, ask-user requests never reached a handler in these SDKs. Each sends requestUserInput on create and resume only when a handler is set.requestId and opaque _meta, and a result's _meta is forwarded back unchanged, in the SDKs that dispatch elicitation requests: Node.js, Python, Go, .NET, Kotlin, Groovy, Erlang, R, Shell, and Solidity. Nim passes requestId and _meta to its handler but can't return _meta. The other additional SDKs declare an elicitation option but don't dispatch elicitation requests yet.permissions.folderTrust.checkTrust, permissions.evaluateManagedPolicy, permissions.locations.cleanupOrphaned, and secrets.filterForHost).UserInputImageResponse with on_user_input_request_with_images (Rust), UserInputImageResponse with scOnUserInputImageRequest and rscOnUserInputImageRequest (Haskell), and User_Input_Image_Response with On_User_Input_Image_Request (Ada)._meta). Code that builds a request value itself, for example a Rust struct literal or a Haskell positional pattern in tests, must account for them.dry_run input.uv for Python; the Copilot runtime packages are excluded because they move with upstream syncs). Merged updates: Jackson 2.23.0 (annotations 2.23), JUnit 5.14.4, and Maven plugin updates for the Java SDK, plus tsx 4.23.15 for the Java code generator.scripts/verify-sdk-coverage.mjs adds 7 feature checks (87 in total).Major release. Copilot CLI 1.0.113 and newer speak SDK protocol 4, which restructures session.create and session.resume options into groups and rejects the flat v3 payloads, so every v2.x SDK fails at startup against a current CLI. This release moves all 40 SDKs to protocol 4 and syncs 284 upstream commits from github/copilot-sdk (now Microsoft Copilot SDK 2.0).
The core SDKs carry upstream's SDK 2.0 code. Follow docs/v2-breaking-changes.md to migrate:
coding-agent or empty); runtime connections (RuntimeConnection.forSpawnedStdio, forSpawnedTcp, forTcp(host, port), forInProcess, forDefault) with in-process hosting as the default.observability, github, models, plugins, extensions, and installations; session options regrouped under inference, tools, permissions, interaction, events, agents, skills, mcp, github, filesystem, execution, instructions, hooks, git, state, plugins, canvases, extensions, experiments, and policy.provider option is replaced by named providers (inference.providers, inference.models, inference.defaultProvider, github.capi).copilot-sdk-supercharged on npm and PyPI, CopilotSDK.Supercharged on NuGet); the .NET namespace becomes Microsoft.Copilot, the Go module path becomes github.com/microsoft/copilot-sdk/go/v2, and the Node.js runtime ships in @microsoft/copilot-sdk-<platform> packages.provider (mapped to a named default provider with Copilot models disabled, matching v2 behavior). Existing code keeps working; the CLI must be 1.0.113 or newer.tool.shell_output events, shell authentication prompts, a memory store callback, network proxy and authentication callbacks, Policy Helper failure details and recheck, and the permission-mode refusal reason.npm-loader.js plus a native binary instead of index.js (COPILOT_CLI_PATH is honored everywhere).core-sdk-tests.yml (Node typecheck and build, Python ruff and unit tests, Go build, vet, and unit tests, .NET build and unit tests); upstream no longer publishes its test infrastructure.scripts/verify-sdk-coverage.mjs adds 12 protocol 4 parity checks and verifies each additional SDK's protocol version constant.npm audit reports 0 vulnerabilities in nodejs/ and test/harness/.Maintenance, security, and documentation release. No public API changes.
copilot-sdk-supercharged (in python/pyproject.toml and the importlib.metadata version lookup in python/copilot/__init__.py) so the Python SDK publishes under the same name used on every other registry, instead of a separate unowned PyPI project.scripts/codegen/python.ts by tightening [^\n]* to [^\r\n]*. Behavior-preserving; resolves the open CodeQL alert.workflow_dispatch triggers plus a manifest-version fallback so a release can be safely re-run without re-tagging.github/copilot-sdkSynced the latest upstream changes. Upstream bumped @github/copilot to 1.0.81-6, which is not yet published on the public npm registry (latest published is 1.0.80), so the bundled CLI runtime is pinned to the latest available release (^1.0.80); all of upstream's SDK type refinements below are included regardless. No breaking changes to the public SDK surface.
user_setting permission source — added the user_setting variant to the PermissionModeSource and PermissionsSetApproveAllSource enums in the core generated SDKs (Node, Python, Go, .NET), so permission decisions originating from a user's saved setting are now distinguishable. (21d738ea)AccountLoginRequest — login is now optional; when omitted, the authenticated user is resolved from the token.jackson-databind + jackson-annotations) 2.17.0 → 2.18.10 in java/pom.xml and java/e2e/pom.xml, resolving 10 Dependabot advisories (CVE-2026-54512, CVE-2026-54513, CVE-2026-54514, CVE-2026-54515, CVE-2026-59888).Maintenance release hardening the additional-language end-to-end test suites. No public API changes.
sessionFs.* provider callbacks (readFile, writeFile, appendFile, exists, stat, mkdir, readdir, readdirWithTypes, rm, rename) so configuring a sessionFs provider no longer fails session creation. Void operations now reply with JSON null (via a JSON-RPC null-result sentinel), matching what the CLI expects.session.idle timeouts; fixed a ping() re-entrancy deadlock during start(); made ModelCapabilities fields optional so model listings decode.SessionConfig/define_tool API, sessionId/get_state accessors) and Scala (session-list assertion, filesystem conventions).github/copilot-sdkSynced the full upstream history and ported every new user-facing feature to all 40 SDKs. New capabilities:
rewind). (#2321)additionalDirectories). (#2180)disabledMcpServers). (#2260)githubMcpToolConfig). (#2112)canvasProvider). (#1847)customAgentsLocalOnly). (#1899)userPromptTransformed hook — observe the transformed user prompt. (#2254)decisionContext on permission replies. (#2294)builtinPluginDirectories). (#2330)argsSchema. (#2114, #2315)reasoningEffort: max — highest reasoning-effort tier. (#2228)toolSearch). (#1933)inProcess). (#1953, #1975, #1976, #1915)experimentalMode). (#1600)contentExclusion).metadata, and startup-timing breakdowns tracked upstream in the core SDKs.All 15 new features are enforced across the 36 additional SDKs by
scripts/verify-sdk-coverage.mjs. Core SDKs (Node, Python, Go, .NET) track upstream directly;
Java and Rust remain first-class supercharged ports.
github/copilot-sdk (through java/v1.0.5-01)Synced the full upstream history from 2026-05-05 to 2026-07-07 and ported every new user-facing feature to all 40 SDKs. New capabilities:
onMcpAuthRequest callback to answer
401 WWW-Authenticate challenges from MCP servers (initial, refresh, reauth, upscope). (#1669)bearerTokenProvider callback (renamed from getBearerToken)
with per-session sessionId scoping for Managed-Identity-style token resolution. (#1748, #1796)enableCitations, excludedBuiltinAgents, and sessionLimits
(per-session AI-credit budget via maxAiCredits). (#1865)memory: { enabled: true } (MemoryConfiguration). (#1617)enableWebSocketResponses and provider.transport. (#1711)defer loading — eager (never) vs. lazy (auto) tool surfacing. (#1632)preamble section and preserve action. (#1713)agentMode and displayPrompt on send. (#1438, #1470)onPostToolUse) and preMcpToolCall. (#1421, #1366)otlpProtocol), experiment assignments (expAssignments),
and GitHub-anchored attachment variants (GitHubCommit, GitHubRelease, …). (#1648, #1750, #1823)All 18 new features are enforced across the 36 additional SDKs by
scripts/verify-sdk-coverage.mjs. Core SDKs (Node, Python, Go, .NET) track upstream directly.
Added documentation for SessionFs, session idle timeout, session metadata, and skills/sub-agent orchestration to all 40 SDK READMEs with language-idiomatic code examples. Updated all 18 sample/example files with v2.0 feature demonstrations.
Created cookbooks with 4 practical recipes each (error handling, multiple sessions, persisting sessions, tools and skills) for Java, Rust, Ruby, PHP, Swift, Kotlin, C++, C, Dart, Scala, R, Perl, Lua, Shell, Elixir, Haskell, and Clojure. 85 files, ~13,800 lines of code examples.
Published the Java SDK to Maven Central under io.github.jeremiahjordanisaacson:copilot-sdk-supercharged. Added publish workflows for 6 new registries: Maven Central, Packagist, pub.dev, Hackage, CPAN, and CRAN.
<dependency>
<groupId>io.github.jeremiahjordanisaacson</groupId>
<artifactId>copilot-sdk-supercharged</artifactId>
<version>2.0.2</version>
</dependency>
SetForegroundSessionRequest for .NETReplaced the anonymous new { sessionId } with a proper SetForegroundSessionRequest record type in SetForegroundSessionIdAsync(). This fixes the runtime System.Text.Json metadata failure when using source-generated serialization (required for AOT/trimming). (upstream #1144)
enableConfigDiscovery for automatic MCP and skill config loadingSet enableConfigDiscovery: true when creating a session to let the runtime automatically discover MCP server configurations (.mcp.json, .vscode/mcp.json) and skill directories from the working directory. Discovered settings are merged with any explicitly provided values; explicit values take precedence on name collision. (#1044)
const session = await client.createSession({
enableConfigDiscovery: true,
});
var session = await client.CreateSessionAsync(new SessionConfig {
EnableConfigDiscovery = true,
});
await client.create_session(enable_config_discovery=True)client.CreateSession(ctx, &copilot.SessionConfig{EnableConfigDiscovery: ptr(true)})Register slash commands that CLI users can invoke and drive interactive input dialogs from any SDK language. This feature was previously Node.js-only; it now ships in Python, Go, and .NET as well. (#906, #908, #960)
const session = await client.createSession({
onPermissionRequest: approveAll,
commands: [{
name: "summarize",
description: "Summarize the conversation",
handler: async (context) => { /* ... */ },
}],
onElicitationRequest: async (context) => {
if (context.type === "confirm") return { action: "confirm" };
},
});
// Drive dialogs from the session
const confirmed = await session.ui.confirm({ message: "Proceed?" });
const choice = await session.ui.select({ message: "Pick one", options: ["A", "B"] });
var session = await client.CreateSessionAsync(new SessionConfig {
OnPermissionRequest = PermissionHandler.ApproveAll,
Commands = [
new CommandDefinition {
Name = "summarize",
Description = "Summarize the conversation",
Handler = async (context) => { /* ... */ },
}
],
});
// Drive dialogs from the session
var confirmed = await session.Ui.ConfirmAsync(new ConfirmOptions { Message = "Proceed?" });
⚠️ Breaking change (Node.js): The
onElicitationRequesthandler signature changed from two arguments (request, invocation) to a singleElicitationContextthat combines both. Update callers to usecontext.sessionIdandcontext.messagedirectly.
session.getMetadata across all SDKsEfficiently fetch metadata for a single session by ID without listing all sessions. Returns undefined/null (not an error) when the session is not found. (#899)
const meta = await client.getSessionMetadata(sessionId);var meta = await client.GetSessionMetadataAsync(sessionId);meta = await client.get_session_metadata(session_id)meta, err := client.GetSessionMetadata(ctx, sessionID)sessionFs for virtualizing per-session storage (Node SDK)Supply a custom sessionFs adapter in Node SDK session config to redirect the runtime's per-session storage (event log, large output files) to any backing store — useful for serverless deployments or custom persistence layers. (#917)
toolTelemetry, resultType, etc.) now sent via RPC as objects instead of being stringified, preserving metadata for Node, Go, and Python SDKs (#970)CopilotClient and CopilotSession now support async with for automatic resource cleanup (#475)copilot.types module removed; import types directly from copilot (#871)workspace_path now accepts any os.PathLike and session.workspace_path returns a pathlib.Path (#901)rpc package API: renamed structs drop the redundant Rpc infix (e.g. ModelRpcApi → ModelApi) (#905)Session.SetModel now takes a pointer for optional options instead of a variadic argument (#904)This is a big update with a broad round of API refinements, new capabilities, and cross-SDK consistency improvements that have shipped incrementally through preview releases since v0.1.32.
A new "customize" mode for systemMessage lets you surgically edit individual sections of the Copilot system prompt — without replacing the entire thing. Ten sections are configurable: identity, tone, tool_efficiency, environment_context, code_change_rules, guidelines, safety, tool_instructions, custom_instructions, and last_instructions.
Each section supports four static actions (replace, remove, append, prepend) and a transform callback that receives the current rendered content and returns modified text — useful for regex mutations, conditional edits, or logging what the prompt contains. (#816)
const session = await client.createSession({
onPermissionRequest: approveAll,
systemMessage: {
mode: "customize",
sections: {
identity: {
action: (current) => current.replace("GitHub Copilot", "Acme Assistant"),
},
tone: { action: "replace", content: "Be concise and professional." },
code_change_rules: { action: "remove" },
},
},
});
var session = await client.CreateSessionAsync(new SessionConfig {
OnPermissionRequest = PermissionHandler.ApproveAll,
SystemMessage = new SystemMessageConfig {
Mode = SystemMessageMode.Customize,
Sections = new Dictionary<string, SectionOverride> {
["identity"] = new() {
Transform = current => Task.FromResult(current.Replace("GitHub Copilot", "Acme Assistant")),
},
["tone"] = new() { Action = SectionOverrideAction.Replace, Content = "Be concise and professional." },
["code_change_rules"] = new() { Action = SectionOverrideAction.Remove },
},
},
});
All four SDK languages now support distributed tracing with the Copilot CLI. Set telemetry in your client options to configure an OTLP exporter; W3C trace context is automatically propagated on session.create, session.resume, and session.send, and restored in tool handlers so tool execution is linked to the originating trace. (#785)
const client = new CopilotClient({
telemetry: {
otlpEndpoint: "http://localhost:4318",
sourceName: "my-app",
},
});
var client = new CopilotClient(new CopilotClientOptions {
Telemetry = new TelemetryConfig {
OtlpEndpoint = "http://localhost:4318",
SourceName = "my-app",
},
});
CopilotClient(SubprocessConfig(telemetry={"otlp_endpoint": "http://localhost:4318", "source_name": "my-app"}))copilot.NewClient(&copilot.ClientOptions{Telemetry: &copilot.TelemetryConfig{OTLPEndpoint: "http://localhost:4318", SourceName: "my-app"}})A new blob attachment type lets you send images or other binary content directly to a session without writing to disk — useful when data is already in memory (screenshots, API responses, generated images). (#731)
await session.send({
prompt: "What's in this image?",
attachments: [{ type: "blob", data: base64Str, mimeType: "image/png" }],
});
await session.SendAsync(new MessageOptions {
Prompt = "What's in this image?",
Attachments = [new UserMessageDataAttachmentsItemBlob { Data = base64Str, MimeType = "image/png" }],
});
You can now specify which custom agent should be active when a session starts, eliminating the need for a separate session.rpc.agent.select() call. (#722)
const session = await client.createSession({
customAgents: [
{ name: "researcher", prompt: "You are a research assistant." },
{ name: "editor", prompt: "You are a code editor." },
],
agent: "researcher",
onPermissionRequest: approveAll,
});
var session = await client.CreateSessionAsync(new SessionConfig {
CustomAgents = [
new CustomAgentConfig { Name = "researcher", Prompt = "You are a research assistant." },
new CustomAgentConfig { Name = "editor", Prompt = "You are a code editor." },
],
Agent = "researcher",
OnPermissionRequest = PermissionHandler.ApproveAll,
});
skipPermission on tool definitions — Tools can now be registered with skipPermission: true to bypass the confirmation prompt for low-risk operations like read-only queries. Available in all four SDKs. (#808)reasoningEffort when switching models — All SDKs now accept an optional reasoningEffort parameter in setModel() for models that support it. (#712)onListModels in client options to override client.listModels() with their own model list. (#730)no-result permission outcome — Permission handlers can now return "no-result" so extensions can attach to sessions without actively answering permission requests. (#802)SessionConfig.onEvent catch-all — A new onEvent handler on session config is registered before the RPC is issued, guaranteeing that early events like session.start are never dropped. (#664)format: "cjs". No changes needed in consumer code. (#546)[Experimental] in C#, /** @experimental */ in TypeScript, and comments in Python and Go. (#875)system.notification events and a session log RPC API. (#737)Client.Start so cancellation no longer kills the child process (#689)DebuggerDisplay attribute to SessionEvent for easier debugging (#726)Task.WhenAny + Task.Delay timeout pattern with .WaitAsync(TimeSpan) (#805)cliPath when cliUrl is already set (#787)We've added low-level RPC methods to control a lot more of what's going on in the session. These are emerging APIs that don't yet have friendly wrappers, and some may be flagged as experimental or subject to change.
session.rpc.skills.list(), .enable(name), .disable(name), .reload()session.rpc.mcp.list(), .enable(name), .disable(name), .reload()session.rpc.extensions.list(), .enable(name), .disable(name), .reload()session.rpc.plugins.list()session.rpc.ui.elicitation(...) — structured user inputsession.rpc.shell.exec(command), .kill(pid)session.log(message, level, ephemeral)In an forthcoming update, we'll add friendlier wrappers for these.
SessionEvent.ToJson() failing for events with JsonElement-backed payloads (assistant.message, tool.execution_start, etc.) (#868)TypeInfoResolver for StreamJsonRpc.RequestId to fix NativeAOT compatibility (#783)autoRestart removed — The autoRestart option has been deprecated across all SDKs (it was never fully implemented). The property still exists but has no effect and will be removed in a future release. Remove any references to autoRestart from your client options. (#803)The Python SDK received a significant API surface overhaul in this release, replacing loosely-typed TypedDict config objects with proper keyword arguments and dataclasses. These changes improve IDE autocompletion, type safety, and readability.
CopilotClient constructor redesigned — The CopilotClientOptions TypedDict has been replaced by two typed config dataclasses. (#793)
# Before (v0.1.x)
client = CopilotClient({"cli_url": "localhost:3000"})
client = CopilotClient({"cli_path": "/usr/bin/copilot", "log_level": "debug"})
# After (v0.2.0)
client = CopilotClient(ExternalServerConfig(url="localhost:3000"))
client = CopilotClient(SubprocessConfig(cli_path="/usr/bin/copilot", log_level="debug"))
create_session() and resume_session() now take keyword arguments instead of a SessionConfig / ResumeSessionConfig TypedDict. on_permission_request is now a required keyword argument. (#587)
# Before
session = await client.create_session({
"on_permission_request": PermissionHandler.approve_all,
"model": "gpt-4.1",
})
# After
session = await client.create_session(
on_permission_request=PermissionHandler.approve_all,
model="gpt-4.1",
)
send() and send_and_wait() take a positional prompt string instead of a MessageOptions TypedDict. Attachments and mode are now keyword arguments. (#814)
# Before
await session.send({"prompt": "Hello!"})
await session.send_and_wait({"prompt": "What is 2+2?"})
# After
await session.send("Hello!")
await session.send_and_wait("What is 2+2?")
MessageOptions, SessionConfig, and ResumeSessionConfig removed from public API — These TypedDicts are no longer exported. Use the new keyword-argument signatures directly. (#587, #814)
Internal modules renamed to private — copilot.jsonrpc, copilot.sdk_protocol_version, and copilot.telemetry are now copilot._jsonrpc, copilot._sdk_protocol_version, and copilot._telemetry. If you were importing from these modules directly, update your imports. (#884)
Typed overloads for CopilotClient.on() — Event registration now uses typed overloads for better autocomplete. This shouldn't break existing code but changes the type signature. (#589)
Client.Start() context no longer kills the CLI process — Previously, canceling the context.Context passed to Start() would terminate the spawned CLI process (it used exec.CommandContext). Now the CLI process lifespan is independent of that context — call client.Stop() or client.ForceStop() to shut it down. (#689)
LogOptions.Ephemeral changed from bool to *bool — This enables proper three-state semantics (unset/true/false). Use copilot.Bool(true) instead of a bare true. (#827)
// Before
session.Log(ctx, copilot.LogOptions{Level: copilot.LevelInfo, Ephemeral: true}, "message")
// After
session.Log(ctx, copilot.LogOptions{Level: copilot.LevelInfo, Ephemeral: copilot.Bool(true)}, "message")
SDK applications written against the v3 API now also work when connected to a v2 CLI server, with no code changes required. The SDK detects the server's protocol version and automatically adapts v2 tool.call and permission.request messages into the same user-facing handlers used by v3. (#706)
const session = await client.createSession({
tools: [myTool], // unchanged — works with v2 and v3 servers
onPermissionRequest: approveAll,
});
var session = await client.CreateSessionAsync(new SessionConfig {
Tools = [myTool], // unchanged — works with v2 and v3 servers
OnPermissionRequest = approveAll,
});
The SDK now uses protocol version 3, where the runtime broadcasts external_tool.requested and permission.requested as session events to all connected clients. This enables multi-client architectures where different clients contribute different tools, or where multiple clients observe the same permission prompts — if one client approves, all clients see the result. Your existing tool and permission handler code is unchanged. (#686)
// Two clients each register different tools; the agent can use both
const session1 = await client1.createSession({
tools: [defineTool("search", { handler: doSearch })],
onPermissionRequest: approveAll,
});
const session2 = await client2.resumeSession(session1.id, {
tools: [defineTool("analyze", { handler: doAnalyze })],
onPermissionRequest: approveAll,
});
var session1 = await client1.CreateSessionAsync(new SessionConfig {
Tools = [AIFunctionFactory.Create(DoSearch, "search")],
OnPermissionRequest = PermissionHandlers.ApproveAll,
});
var session2 = await client2.ResumeSessionAsync(session1.Id, new ResumeSessionConfig {
Tools = [AIFunctionFactory.Create(DoAnalyze, "analyze")],
OnPermissionRequest = PermissionHandlers.ApproveAll,
});
PermissionRequestResultKind for .NET and GoRather than comparing result.Kind against undiscoverable magic strings like "approved" or "denied-interactively-by-user", .NET and Go now provide typed constants. Node and Python already had typed unions for this; this brings full parity. (#631)
session.OnPermissionCompleted += (e) => {
if (e.Result.Kind == PermissionRequestResultKind.Approved) { /* ... */ }
if (e.Result.Kind == PermissionRequestResultKind.DeniedInteractivelyByUser) { /* ... */ }
};
// Go: PermissionKindApproved, PermissionKindDeniedByRules,
// PermissionKindDeniedCouldNotRequestFromUser, PermissionKindDeniedInteractivelyByUser
if result.Kind == copilot.PermissionKindApproved { /* ... */ }
get_last_session_id() / GetLastSessionID() for SDK-wide parity (was already available in Node and .NET) (#671)timeout parameter to generated RPC methods, allowing callers to override the default 30s timeout for long-running operations (#681)PermissionRequest fields are now properly typed (ToolName, Diff, Path, etc.) instead of a generic Extra map[string]any catch-all (#685)Applications can now override built-in tools such as grep, edit_file, or read_file. To do this, register a custom tool with the same name and set the override flag. Without the flag, the runtime will return an error if the name clashes with a built-in. (#636)
import { defineTool } from "@github/copilot-sdk";
const session = await client.createSession({
tools: [defineTool("grep", {
overridesBuiltInTool: true,
handler: async (params) => `CUSTOM_GREP_RESULT: ${params.query}`,
})],
onPermissionRequest: approveAll,
});
var grep = AIFunctionFactory.Create(
([Description("Search query")] string query) => $"CUSTOM_GREP_RESULT: {query}",
"grep",
"Custom grep implementation",
new AIFunctionFactoryOptions
{
AdditionalProperties = new ReadOnlyDictionary<string, object?>(
new Dictionary<string, object?> { ["is_override"] = true })
});
While session.rpc.model.switchTo() already worked, there is now a convenience method directly on the session object. (#621)
await session.setModel("gpt-4.1")await session.SetModelAsync("gpt-4.1")await session.set_model("gpt-4.1")err := session.SetModel(ctx, "gpt-4.1")OnDisposeCall and improve implementation (#626)SemaphoreSlim locks for handler fields (#625)PermissionHandler.approve_all type annotations (#618)Can you improve this documentation? These fine people already did:
Jeremiah Isaacson, github-actions[bot] & Steve SandersonEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |