Skip to content

Commit 6d09534

Browse files
committed
release: sync copilot-sdk-cpp v0.4.0
Re-pins the SDK to @github/copilot 1.0.84-5 (github/copilot-sdk f45c46fd), regenerates the protocol layer, and adds the API surface that came with it. The wire protocol is unchanged at version 3, so this is compatible with servers the previous release worked against. Fixes - FFI transport could unload the runtime library while it still held our callback. copilot_runtime_connection_close returning false does not mean failure -- it means the runtime has not quiesced yet. close() discarded that result, shut the host down and unloaded the library regardless, so a late callback could land in unmapped memory. It now retries until the runtime agrees, and if it never does, the library is deliberately left loaded rather than freed out from under it. Affects in-process transport users only (connection.ffi_library_path). - Bracketed IPv6 runtime URLs such as "[::1]:4000" failed to parse: the host pattern stopped at the address's own colons. Added - ClientOptions::client_info (CopilotClientInfo) declares the integrating application on the connect handshake so the runtime attributes telemetry to a consistent surface. Note the public names are application/integration while the protocol spells them editor/extension; the mapping is handled for you. - MessageOptions::source (MessageSource) tags message provenance as user, system, or agent-<id>. - Session::set_auto_tier() over session.model.switchAutoTier, with AutoTier and AutoTierResult. Passing nullopt returns the session to provider-default Auto routing. The switch is deferred until a future turn mints a replacement model, which is why the result reports a status and a pending tier rather than completing inline. - SessionConfig and ResumeSessionConfig gain feature_flags and auth_client_id_metadata_url. - Client::clear_managed_settings_cache() over managedSettings.clearCache. - 11 new session event types are mapped rather than falling through to SessionEventType::Unknown. Their payloads are exposed as raw JSON for now. Generated surface API definitions 1218 -> 1293 event definitions 535 -> 576 RPC methods 367 -> 384 event variants 133 -> 144 The codegen validator now reads the CLI version from nodejs/src/cliVersion.ts with a fallback to package-lock.json, since upstream moved CLI acquisition to GitHub Releases and the old lookup raised an undiagnosable KeyError. Not yet ported from this upstream range: session detach for cleanup (github/copilot-sdk fcffcdf0) and cancelling pending host tool invocations on connection close (53e74d81). Both are session-lifecycle changes.
1 parent 790ba0e commit 6d09534

17 files changed

Lines changed: 3875 additions & 389 deletions

‎CMakeLists.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.20)
2-
project(copilot_sdk_cpp VERSION 0.3.0 LANGUAGES CXX)
2+
project(copilot_sdk_cpp VERSION 0.4.0 LANGUAGES CXX)
33

44
# Enable folder organization in IDEs
55
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

‎include/copilot/client.hpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,13 @@ class Client
166166
/// @return Future that completes when deleted
167167
std::future<void> delete_session(const std::string& session_id);
168168

169+
/// Force the runtime to drop its cached managed-settings snapshot.
170+
///
171+
/// Calls managedSettings.clearCache. Useful when the host has changed managed
172+
/// settings out-of-band and wants the next read to re-resolve them rather than
173+
/// wait for the runtime's own cache expiry.
174+
std::future<void> clear_managed_settings_cache();
175+
169176
/// Get the ID of the most recently used session
170177
/// @return Future that resolves to session ID or nullopt if none
171178
std::future<std::optional<std::string>> get_last_session_id();

‎include/copilot/events.hpp‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3106,6 +3106,18 @@ enum class SessionEventType
31063106
SessionCanvasRemoved,
31073107
SessionExtensionsAttachmentsPushed,
31083108
McpAppToolCallComplete,
3109+
// Added with the @github/copilot 1.0.84-5 re-pin (upstream f45c46fd).
3110+
SessionAutoTierRecommendation,
3111+
SessionAutoTierSwitchFailed,
3112+
SessionModeNoticeDelivered,
3113+
SessionCompletionReceipt,
3114+
AssistantFusionPhaseActivity,
3115+
PermissionCarriedForward,
3116+
PermissionMessageAuthorization,
3117+
PermissionMessageAuthorizationRead,
3118+
PermissionMessageAuthorizationDegraded,
3119+
SessionMcpServerRemoved,
3120+
SessionMcpServerNeedsReconnect,
31093121
Unknown
31103122
};
31113123

@@ -3439,6 +3451,21 @@ inline SessionEvent parse_session_event(const json& j)
34393451
{"session.canvas.removed", SessionEventType::SessionCanvasRemoved},
34403452
{"session.extensions.attachments_pushed", SessionEventType::SessionExtensionsAttachmentsPushed},
34413453
{"mcp_app.tool_call_complete", SessionEventType::McpAppToolCallComplete},
3454+
// @github/copilot 1.0.84-5 (upstream f45c46fd). Wire spellings are taken
3455+
// verbatim from the generated kSessionEventWireTypes -- note the mixed
3456+
// conventions upstream uses under permission.*, which are not typos here.
3457+
{"session.auto_tier_recommendation", SessionEventType::SessionAutoTierRecommendation},
3458+
{"session.auto_tier_switch_failed", SessionEventType::SessionAutoTierSwitchFailed},
3459+
{"session.mode_notice_delivered", SessionEventType::SessionModeNoticeDelivered},
3460+
{"session.completion_receipt", SessionEventType::SessionCompletionReceipt},
3461+
{"assistant.fusion_phase_activity", SessionEventType::AssistantFusionPhaseActivity},
3462+
{"permission.carriedForward", SessionEventType::PermissionCarriedForward},
3463+
{"permission.messageAuthorization", SessionEventType::PermissionMessageAuthorization},
3464+
{"permission.messageAuthorizationRead", SessionEventType::PermissionMessageAuthorizationRead},
3465+
{"permission.messageAuthorizationDegraded",
3466+
SessionEventType::PermissionMessageAuthorizationDegraded},
3467+
{"session.mcp_server_removed", SessionEventType::SessionMcpServerRemoved},
3468+
{"session.mcp_server_needs_reconnect", SessionEventType::SessionMcpServerNeedsReconnect},
34423469
};
34433470

34443471
auto it = type_map.find(event.type_string);

‎include/copilot/generated/api_types.hpp‎

Lines changed: 1051 additions & 59 deletions
Large diffs are not rendered by default.

‎include/copilot/generated/protocol_version.hpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace copilot::generated
99

1010
inline constexpr int kSdkProtocolVersion = 3;
1111
inline constexpr int kMinProtocolVersion = 2;
12-
inline constexpr std::string_view kOfficialSdkCommit = "7a916f8af8fb11315e9d043156487f9076264145";
13-
inline constexpr std::string_view kOfficialSchemaPackageVersion = "1.0.83-0";
12+
inline constexpr std::string_view kOfficialSdkCommit = "f45c46fd1812f8bed5b4cbc250f47177c83068f0";
13+
inline constexpr std::string_view kOfficialSchemaPackageVersion = "1.0.84-5";
1414

1515
} // namespace copilot::generated

‎include/copilot/generated/schema_coverage.hpp‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@
88
namespace copilot::generated::coverage
99
{
1010

11-
inline constexpr std::size_t kApiDefinitionCount = 1218;
12-
inline constexpr std::size_t kSessionEventDefinitionCount = 535;
13-
inline constexpr std::size_t kSharedDefinitionCount = 54;
14-
inline constexpr std::size_t kUniqueDefinitionCount = 1699;
15-
inline constexpr std::size_t kRpcMethodCount = 367;
16-
inline constexpr std::size_t kSessionEventVariantCount = 133;
17-
inline constexpr std::string_view kApiSchemaSha256 = "a72281ca260a3d30d6dc032f0cae658b888c229303f667b68bce2b06d8969ca4";
18-
inline constexpr std::string_view kSessionEventsSchemaSha256 = "93fb5153ae3e7074b59a0e3cd955620be2eb32aa136390a54e7c9ca7338cc088";
19-
inline constexpr std::string_view kApiDefinitionNamesSha256 = "dca4ad051f0a5d7a941c052b383320e72c8aef2381f7eadfc7a59716958e9735";
20-
inline constexpr std::string_view kSessionEventDefinitionNamesSha256 = "4b12faefa692495c733580ab9b8570935e1e2f731dd0def6c798599560310994";
21-
inline constexpr std::string_view kRpcMethodNamesSha256 = "c65f6212528f0b246c2a23c75e9266312cd5709c72ef45b0a3d82e4cf563a40e";
22-
inline constexpr std::string_view kSessionEventWireTypesSha256 = "ba940ba0dc09f70b00f9c972e63306114e059d164cce153de71e27bf2dc047cb";
23-
inline constexpr std::string_view kSurfaceSha256 = "7b8f469d6f67bbd2dc73471f334f2864fe9c0e2b24a6ba411e70446dec1978ce";
11+
inline constexpr std::size_t kApiDefinitionCount = 1293;
12+
inline constexpr std::size_t kSessionEventDefinitionCount = 576;
13+
inline constexpr std::size_t kSharedDefinitionCount = 58;
14+
inline constexpr std::size_t kUniqueDefinitionCount = 1811;
15+
inline constexpr std::size_t kRpcMethodCount = 384;
16+
inline constexpr std::size_t kSessionEventVariantCount = 144;
17+
inline constexpr std::string_view kApiSchemaSha256 = "5835517c600d1661bb857aa74deeb2abd2cfb9ed1e69cdedd1402181ea9eca98";
18+
inline constexpr std::string_view kSessionEventsSchemaSha256 = "fded8ae9faa212cc84adae273c8b107a450b90ab66a723ee03e9057d41f8e4c5";
19+
inline constexpr std::string_view kApiDefinitionNamesSha256 = "374f18544d37959a909d1852524008b95b656b1db7f53890abc606cee8120077";
20+
inline constexpr std::string_view kSessionEventDefinitionNamesSha256 = "21e92237ac86ce0a8e6a2e1554369b83a413f9a6006c03d40f0709a409758ffc";
21+
inline constexpr std::string_view kRpcMethodNamesSha256 = "940bc904071d6292b0707fc71523fc78aad5cd73a2a1df8dc03f388bc1ef1b27";
22+
inline constexpr std::string_view kSessionEventWireTypesSha256 = "e149d65f991cac05fd210a93dd034d4bad7c4ba02e1bf443fb5c9b5af8850e33";
23+
inline constexpr std::string_view kSurfaceSha256 = "d8c46b04dd0fee2eee2552833266fa12a97b403667c9f541d59716e602229689";
2424

2525
} // namespace copilot::generated::coverage

0 commit comments

Comments
 (0)