@@ -179,15 +179,15 @@ private void verifyProtocolVersion(Connection connection) throws Exception {
179179 params .put ("message" , null );
180180 PingResponse pingResponse = connection .rpc .invoke ("ping" , params , PingResponse .class ).get (30 , TimeUnit .SECONDS );
181181
182- if (pingResponse .getProtocolVersion () == null ) {
182+ if (pingResponse .protocolVersion () == null ) {
183183 throw new RuntimeException ("SDK protocol version mismatch: SDK expects version " + expectedVersion
184184 + ", but server does not report a protocol version. "
185185 + "Please update your server to ensure compatibility." );
186186 }
187187
188- if (pingResponse .getProtocolVersion () != expectedVersion ) {
188+ if (pingResponse .protocolVersion () != expectedVersion ) {
189189 throw new RuntimeException ("SDK protocol version mismatch: SDK expects version " + expectedVersion
190- + ", but server reports version " + pingResponse .getProtocolVersion () + ". "
190+ + ", but server reports version " + pingResponse .protocolVersion () + ". "
191191 + "Please update your SDK or server to ensure compatibility." );
192192 }
193193 }
@@ -272,9 +272,9 @@ public CompletableFuture<CopilotSession> createSession(SessionConfig config) {
272272 var request = SessionRequestBuilder .buildCreateRequest (config );
273273
274274 return connection .rpc .invoke ("session.create" , request , CreateSessionResponse .class ).thenApply (response -> {
275- var session = new CopilotSession (response .getSessionId (), connection .rpc , response .getWorkspacePath ());
275+ var session = new CopilotSession (response .sessionId (), connection .rpc , response .workspacePath ());
276276 SessionRequestBuilder .configureSession (session , config );
277- sessions .put (response .getSessionId (), session );
277+ sessions .put (response .sessionId (), session );
278278 return session ;
279279 });
280280 });
@@ -310,9 +310,9 @@ public CompletableFuture<CopilotSession> resumeSession(String sessionId, ResumeS
310310 var request = SessionRequestBuilder .buildResumeRequest (sessionId , config );
311311
312312 return connection .rpc .invoke ("session.resume" , request , ResumeSessionResponse .class ).thenApply (response -> {
313- var session = new CopilotSession (response .getSessionId (), connection .rpc , response .getWorkspacePath ());
313+ var session = new CopilotSession (response .sessionId (), connection .rpc , response .workspacePath ());
314314 SessionRequestBuilder .configureSession (session , config );
315- sessions .put (response .getSessionId (), session );
315+ sessions .put (response .sessionId (), session );
316316 return session ;
317317 });
318318 });
@@ -432,7 +432,7 @@ public CompletableFuture<List<ModelInfo>> listModels() {
432432 public CompletableFuture <String > getLastSessionId () {
433433 return ensureConnected ().thenCompose (
434434 connection -> connection .rpc .invoke ("session.getLastId" , Map .of (), GetLastSessionIdResponse .class )
435- .thenApply (GetLastSessionIdResponse ::getSessionId ));
435+ .thenApply (GetLastSessionIdResponse ::sessionId ));
436436 }
437437
438438 /**
@@ -450,9 +450,8 @@ public CompletableFuture<Void> deleteSession(String sessionId) {
450450 return ensureConnected ().thenCompose (connection -> connection .rpc
451451 .invoke ("session.delete" , Map .of ("sessionId" , sessionId ), DeleteSessionResponse .class )
452452 .thenAccept (response -> {
453- if (!response .isSuccess ()) {
454- throw new RuntimeException (
455- "Failed to delete session " + sessionId + ": " + response .getError ());
453+ if (!response .success ()) {
454+ throw new RuntimeException ("Failed to delete session " + sessionId + ": " + response .error ());
456455 }
457456 sessions .remove (sessionId );
458457 }));
@@ -471,7 +470,7 @@ public CompletableFuture<Void> deleteSession(String sessionId) {
471470 public CompletableFuture <List <SessionMetadata >> listSessions () {
472471 return ensureConnected ()
473472 .thenCompose (connection -> connection .rpc .invoke ("session.list" , Map .of (), ListSessionsResponse .class )
474- .thenApply (ListSessionsResponse ::getSessions ));
473+ .thenApply (ListSessionsResponse ::sessions ));
475474 }
476475
477476 /**
@@ -487,7 +486,7 @@ public CompletableFuture<String> getForegroundSessionId() {
487486 return ensureConnected ().thenCompose (connection -> connection .rpc
488487 .invoke ("session.getForeground" , Map .of (),
489488 com .github .copilot .sdk .json .GetForegroundSessionResponse .class )
490- .thenApply (com .github .copilot .sdk .json .GetForegroundSessionResponse ::getSessionId ));
489+ .thenApply (com .github .copilot .sdk .json .GetForegroundSessionResponse ::sessionId ));
491490 }
492491
493492 /**
@@ -509,9 +508,9 @@ public CompletableFuture<Void> setForegroundSessionId(String sessionId) {
509508 .invoke ("session.setForeground" , Map .of ("sessionId" , sessionId ),
510509 com .github .copilot .sdk .json .SetForegroundSessionResponse .class )
511510 .thenAccept (response -> {
512- if (!response .isSuccess ()) {
513- throw new RuntimeException (response .getError () != null
514- ? response .getError ()
511+ if (!response .success ()) {
512+ throw new RuntimeException (response .error () != null
513+ ? response .error ()
515514 : "Failed to set foreground session" );
516515 }
517516 }));
0 commit comments