From 5f838447bb91caf3ef7ec36a4485b2a90c442f5f Mon Sep 17 00:00:00 2001 From: Elias Bachaalany Date: Sat, 24 Jan 2026 01:15:06 -0800 Subject: [PATCH] fix: update SDK protocol version to v2 Copilot CLI v0.0.394 uses protocol version 2. Update kSdkProtocolVersion from 1 to 2 to match. --- include/copilot/types.hpp | 2 +- tests/test_types.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/copilot/types.hpp b/include/copilot/types.hpp index ddbf186..7313a15 100644 --- a/include/copilot/types.hpp +++ b/include/copilot/types.hpp @@ -32,7 +32,7 @@ struct SessionEvent; // ============================================================================= /// SDK protocol version - must match copilot-agent-runtime server -inline constexpr int kSdkProtocolVersion = 1; +inline constexpr int kSdkProtocolVersion = 2; // ============================================================================= // Enums diff --git a/tests/test_types.cpp b/tests/test_types.cpp index 4d07e0b..c1c653f 100644 --- a/tests/test_types.cpp +++ b/tests/test_types.cpp @@ -153,17 +153,17 @@ TEST(TypesTest, MessageOptions) TEST(TypesTest, PingResponse) { - json input = {{"message", "pong"}, {"timestamp", 1234567890}, {"protocolVersion", 1}}; + json input = {{"message", "pong"}, {"timestamp", 1234567890}, {"protocolVersion", 2}}; auto resp = input.get(); EXPECT_EQ(resp.message, "pong"); EXPECT_EQ(resp.timestamp, 1234567890); - EXPECT_EQ(resp.protocol_version, 1); + EXPECT_EQ(resp.protocol_version, 2); } TEST(TypesTest, ProtocolVersion) { - EXPECT_EQ(kSdkProtocolVersion, 1); + EXPECT_EQ(kSdkProtocolVersion, 2); } TEST(TypesTest, SessionMetadataParsesIso8601Timestamps)