Skip to content

Commit 5404601

Browse files
authored
test: add E2E tests for parity sync features (#9)
* feat: parity sync with Python SDK — types, client API, events, tool builder - Add LogLevel, ToolResultType, ReasoningEffort enums with JSON serde - Add StopError struct and MCPServerConfig variant type - Add on_lifecycle(), get/set_foreground_session_id() client methods - Change stop() to return future<vector<StopError>> - Set COPILOT_SDK_AUTH_TOKEN env var when github_token provided - Smart use_logged_in_user default (false with token, true without) - Add SessionShutdown event type with full data parsing - Add normalize_result<T>() and error-safe handler wrappers in tool builder - Add URL parsing, large payload JSONRPC, and event forward-compat tests * test: add 10 E2E tests for parity sync features Cover foreground session API, graceful stop, lifecycle events, user input handlers, pre/post tool hooks, user prompt submitted hook, tool handler exception safety, and make_tool normalize_result.
1 parent 9e49f30 commit 5404601

27 files changed

Lines changed: 1243 additions & 86 deletions

examples/attachments.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main()
3838
try
3939
{
4040
copilot::ClientOptions options;
41-
options.log_level = "info";
41+
options.log_level = copilot::LogLevel::Info;
4242

4343
copilot::Client client(options);
4444

examples/basic_chat.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main()
1414
{
1515
// Create client with default options (uses stdio transport)
1616
copilot::ClientOptions options;
17-
options.log_level = "info";
17+
options.log_level = copilot::LogLevel::Info;
1818

1919
copilot::Client client(options);
2020

examples/byok.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main(int argc, char* argv[])
7676

7777
// Create client
7878
copilot::ClientOptions options;
79-
options.log_level = "info";
79+
options.log_level = copilot::LogLevel::Info;
8080

8181
copilot::Client client(options);
8282

examples/compaction_events.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main()
2323
try
2424
{
2525
copilot::ClientOptions options;
26-
options.log_level = "info";
26+
options.log_level = copilot::LogLevel::Info;
2727

2828
copilot::Client client(options);
2929

examples/custom_agents.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main()
2323
try
2424
{
2525
copilot::ClientOptions options;
26-
options.log_level = "info";
26+
options.log_level = copilot::LogLevel::Info;
2727

2828
copilot::Client client(options);
2929

examples/fluent_tools.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int main()
150150
std::cout << "=== Starting Copilot Session ===\n\n";
151151

152152
ClientOptions opts;
153-
opts.log_level = "info";
153+
opts.log_level = LogLevel::Info;
154154
opts.use_stdio = true;
155155
Client client(opts);
156156

examples/list_models.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main()
1919
try
2020
{
2121
copilot::ClientOptions options;
22-
options.log_level = "info";
22+
options.log_level = copilot::LogLevel::Info;
2323

2424
copilot::Client client(options);
2525

examples/mcp/inprocess/mcp_inprocess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ int main()
195195
std::cout << "Creating Copilot SDK client...\n";
196196

197197
copilot::ClientOptions client_opts;
198-
client_opts.log_level = "info";
198+
client_opts.log_level = copilot::LogLevel::Info;
199199

200200
copilot::Client client(client_opts);
201201
client.start().get();

examples/mcp_servers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ int main()
2323
try
2424
{
2525
copilot::ClientOptions options;
26-
options.log_level = "info";
26+
options.log_level = copilot::LogLevel::Info;
2727

2828
copilot::Client client(options);
2929

examples/permission_callback.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ int main()
6262

6363
// Create client
6464
copilot::ClientOptions options;
65-
options.log_level = "info";
65+
options.log_level = copilot::LogLevel::Info;
6666

6767
copilot::Client client(options);
6868

0 commit comments

Comments
 (0)