You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[java] Warning logged "Unhandled method connect" during the execution of the tutorial #2291
I followed the java tutorial and it worked but gives ugly warning in the log what makes one think something is wrong.
As I can't find any connection to the client code itself it seems something inside the SDK itself the user can not influence.
Aug. 07, 2026 7:10:49 AM com.github.copilot.LoggingHelpers logTiming
WARNUNG: JsonRpc.invoke JSON-RPC request finished. Elapsed=PT0.793S, Method=connect, RequestId=1, Status=Failed
java.util.concurrent.CompletionException: com.github.copilot.JsonRpcException: Unhandled method connect
at java.base/java.util.concurrent.CompletableFuture.wrapInCompletionException(CompletableFuture.java:323)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:376)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:391)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:657)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:531)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2221)
at com.github.copilot.JsonRpcClient.handleMessage(JsonRpcClient.java:282)
at com.github.copilot.JsonRpcClient.lambda$startReader$0(JsonRpcClient.java:257)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:545)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:328)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1090)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:614)
at java.base/java.lang.Thread.run(Thread.java:1474)
Caused by: com.github.copilot.JsonRpcException: Unhandled method connect
... 7 more
Files examined:java/src/main/java/com/github/copilot/JsonRpcClient.java and java/src/main/java/com/github/copilot/CopilotClient.java
Root cause: This is a genuine bug — a misleading WARNING log that fires for an expected, recoverable error.
Here's what happens:
CopilotClient.verifyProtocolVersion() first tries to call connect on the server.
If the server is a legacy version that doesn't support connect, it throws JsonRpcException: Unhandled method connect.
CopilotClientcorrectly catches this and falls back to calling ping — the entire flow succeeds.
However, before the catch in CopilotClient executes, the exceptionally handler in JsonRpcClient.invoke() (line 141-146) unconditionally logs the failure at Level.WARNING:
Closing as not supported — this warning fires only when your CLI predates the SDK's expected protocol version. We only support the SDK paired with its bundled CLI version; mismatched versions (like this one) aren't a supported configuration. See #2310 for the related PR discussion.
Activity
github-actions commentedon Aug 7, 2026
Investigation findings
Files examined:
java/src/main/java/com/github/copilot/JsonRpcClient.javaandjava/src/main/java/com/github/copilot/CopilotClient.javaRoot cause: This is a genuine bug — a misleading
WARNINGlog that fires for an expected, recoverable error.Here's what happens:
CopilotClient.verifyProtocolVersion()first tries to callconnecton the server.connect, it throwsJsonRpcException: Unhandled method connect.CopilotClientcorrectly catches this and falls back to callingping— the entire flow succeeds.However, before the catch in
CopilotClientexecutes, theexceptionallyhandler inJsonRpcClient.invoke()(line 141-146) unconditionally logs the failure atLevel.WARNING:This warning fires even when the caller fully expects and handles the failure. The fix would be to either:
FINElevel inJsonRpcClient.invoke()(let callers decide on severity), orFINElevel insideCopilotClientwhen catching the expectedconnectfailure.The SDK is working correctly — the fallback to
pingsucceeds — but the warning is alarming and should be suppressed for this expected case.Labeling as bug since the log level is incorrect/misleading for an intentionally handled scenario.
fix(java): stop logging the legacy 'connect' probe failure as a warning
fix(java): stop logging the legacy 'connect' probe failure as a warning
SteveSandersonMS commentedon Sep 3, 2026
Closing as not supported — this warning fires only when your CLI predates the SDK's expected protocol version. We only support the SDK paired with its bundled CLI version; mismatched versions (like this one) aren't a supported configuration. See #2310 for the related PR discussion.