Skip to content

Commit 85fca4c

Browse files
author
Mark Pollack
committed
Deprecate the session-model API for removal
The session/set_model method and related model types were removed from the ACP spec (June 2026, v0.13.5). Model selection now flows through session/set_config_option with a config option whose category is "model", which this SDK already supports. Mark the whole surface @deprecated(forRemoval = true) (and @UnstableAcpApi on the types/annotation), with Javadoc pointing to the replacement: - METHOD_SESSION_SET_MODEL, SetSessionModelRequest/Response - SessionModelState, ModelInfo, and the models field on the new/load/resume/ fork session responses - SetSessionModelHandler / SyncSetSessionModelHandler and their builder setters - AcpAsyncClient/AcpSyncClient.setSessionModel - @SetSessionModel and SetSessionModelRequestResolver Internal wiring that must keep referencing the surface during the deprecation window carries narrow @SuppressWarnings("removal"); main sources compile with no deprecation warnings. The method stays functional until a future release.
1 parent 558bcc5 commit 85fca4c

13 files changed

Lines changed: 123 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
Protocol currency: catching up to ACP spec v0.13.6 (June 2026).
11+
12+
### Added
13+
14+
- `logout` method (`AcpAsyncClient`/`AcpSyncClient.logout`, `@Logout`, agent handler) — clears
15+
stored credentials.
16+
- `session/delete` method (`deleteSession`, `@DeleteSession`, agent handler) — permanently deletes a
17+
stored session; gated on the `sessionCapabilities.delete` capability.
18+
- `additionalDirectories` on `session/new`, `session/load`, `session/resume`, `session/fork` requests
19+
and on `SessionInfo` — extra workspace roots beyond `cwd`.
20+
- Per-chunk `messageId` on `AgentMessageChunk`, `AgentThoughtChunk`, `UserMessageChunk`.
21+
- `sessionCapabilities.delete` and `sessionCapabilities.additionalDirectories`, surfaced via
22+
`NegotiatedCapabilities` (`supports*`/`require*`).
23+
24+
### Deprecated
25+
26+
- The session-model API — `session/set_model` (`setSessionModel`, `@SetSessionModel`, handler),
27+
`SetSessionModelRequest`/`SetSessionModelResponse`, `SessionModelState`, `ModelInfo`, and the
28+
`models` field on the new/load/resume/fork session responses — is deprecated for removal. The spec
29+
removed it (June 2026, v0.13.5); expose model selection through `session/set_config_option` with a
30+
config option whose `category` is `"model"` instead. Scheduled for removal in a future release.
31+
832
## [0.9.0] - 2026-02-XX
933

1034
### Added

acp-agent-support/src/main/java/com/agentclientprotocol/sdk/agent/support/AcpAgentSupport.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ public AcpSyncAgent getAgent() {
183183
return agent;
184184
}
185185

186+
@SuppressWarnings("removal") // wires the deprecated-for-removal session/set_model handler
186187
private void wireHandlers(AcpAgent.SyncAgentBuilder agentBuilder) {
187188
// Initialize handler
188189
AcpHandlerMethod initHandler = handlers.get("initialize");
@@ -470,6 +471,7 @@ public AcpAgentSupport build() {
470471
return new AcpAgentSupport(this);
471472
}
472473

474+
@SuppressWarnings("removal") // discovers the deprecated-for-removal @SetSessionModel
473475
private void discoverHandlers(Class<?> agentClass, Supplier<Object> beanSupplier) {
474476
if (!agentClass.isAnnotationPresent(
475477
com.agentclientprotocol.sdk.annotation.AcpAgent.class)) {
@@ -538,6 +540,7 @@ private void discoverHandlers(Class<?> agentClass, Supplier<Object> beanSupplier
538540
}
539541
}
540542

543+
@SuppressWarnings("removal") // registers the deprecated-for-removal SetSessionModelRequestResolver
541544
private void addDefaultResolvers() {
542545
// Built-in resolvers (order matters - first match wins)
543546
// Custom resolvers added via builder go first

acp-agent-support/src/main/java/com/agentclientprotocol/sdk/agent/support/handler/DirectResponseHandler.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
public class DirectResponseHandler implements ReturnValueHandler {
3434

3535
@Override
36+
@SuppressWarnings("removal") // recognizes the deprecated-for-removal SetSessionModelResponse
3637
public boolean supportsReturnType(AcpMethodParameter returnType) {
3738
Class<?> type = returnType.getParameterType();
3839
return InitializeResponse.class.isAssignableFrom(type)

acp-agent-support/src/main/java/com/agentclientprotocol/sdk/agent/support/resolver/SetSessionModelRequestResolver.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
*
1414
* @author Mark Pollack
1515
* @since 1.0.0
16+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
17+
* (June 2026). Slated for removal along with the rest of the session-model API.
1618
*/
19+
@Deprecated(forRemoval = true)
20+
@SuppressWarnings("removal")
1721
public class SetSessionModelRequestResolver implements ArgumentResolver {
1822

1923
@Override

acp-agent-support/src/test/java/com/agentclientprotocol/sdk/agent/support/AcpAgentSupportTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ SetSessionModeResponse setMode(SetSessionModeRequest req) {
339339
}
340340

341341
@Test
342+
@SuppressWarnings("removal") // exercises the deprecated-for-removal session/set_model handler
342343
void setSessionModelHandlerInvoked() throws Exception {
343344
AtomicReference<String> receivedModelId = new AtomicReference<>();
344345

acp-annotations/src/main/java/com/agentclientprotocol/sdk/annotation/SetSessionModel.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
* @since 1.0.0
4343
* @see AcpAgent
4444
* @see SetSessionMode
45+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
46+
* (June 2026). Expose model selection through {@code session/set_config_option} with a
47+
* config option whose {@code category} is {@code "model"} instead (handled with
48+
* {@link SetSessionConfigOption}). Slated for removal.
4549
*/
50+
@Deprecated(forRemoval = true)
51+
@UnstableAcpApi
4652
@Target(ElementType.METHOD)
4753
@Retention(RetentionPolicy.RUNTIME)
4854
@Documented

acp-core/src/main/java/com/agentclientprotocol/sdk/agent/AcpAgent.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import java.util.concurrent.Executors;
1010

11+
import com.agentclientprotocol.sdk.annotation.UnstableAcpApi;
1112
import com.agentclientprotocol.sdk.spec.AcpAgentTransport;
1213
import com.agentclientprotocol.sdk.spec.AcpSchema;
1314
import com.agentclientprotocol.sdk.util.Assert;
@@ -220,8 +221,15 @@ interface SetSessionModeHandler {
220221

221222
/**
222223
* Functional interface for handling set session model requests.
224+
*
225+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
226+
* (June 2026). Use {@code session/set_config_option} with a {@code "model"} category
227+
* config option instead. Slated for removal.
223228
*/
229+
@Deprecated(forRemoval = true)
230+
@UnstableAcpApi
224231
@FunctionalInterface
232+
@SuppressWarnings("removal")
225233
interface SetSessionModelHandler {
226234

227235
Mono<AcpSchema.SetSessionModelResponse> handle(AcpSchema.SetSessionModelRequest request);
@@ -407,8 +415,15 @@ interface SyncSetSessionModeHandler {
407415
/**
408416
* Synchronous functional interface for handling set session model requests.
409417
* Returns a plain value instead of Mono for use with sync agents.
418+
*
419+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
420+
* (June 2026). Use {@code session/set_config_option} with a {@code "model"} category
421+
* config option instead. Slated for removal.
410422
*/
423+
@Deprecated(forRemoval = true)
424+
@UnstableAcpApi
411425
@FunctionalInterface
426+
@SuppressWarnings("removal")
412427
interface SyncSetSessionModelHandler {
413428

414429
AcpSchema.SetSessionModelResponse handle(AcpSchema.SetSessionModelRequest request);
@@ -513,6 +528,7 @@ class AsyncAgentBuilder {
513528

514529
private SetSessionModeHandler setSessionModeHandler;
515530

531+
@SuppressWarnings("removal")
516532
private SetSessionModelHandler setSessionModelHandler;
517533

518534
private ListSessionsHandler listSessionsHandler;
@@ -619,7 +635,11 @@ public AsyncAgentBuilder setSessionModeHandler(SetSessionModeHandler handler) {
619635
* Sets the handler for set session model requests.
620636
* @param handler The set session model handler
621637
* @return This builder for chaining
638+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
639+
* (June 2026). Use {@code session/set_config_option} with a {@code "model"} category
640+
* config option instead. Slated for removal.
622641
*/
642+
@Deprecated(forRemoval = true)
623643
public AsyncAgentBuilder setSessionModelHandler(SetSessionModelHandler handler) {
624644
this.setSessionModelHandler = handler;
625645
return this;
@@ -821,7 +841,12 @@ public SyncAgentBuilder setSessionModeHandler(SyncSetSessionModeHandler handler)
821841
* Sets the synchronous handler for set session model requests.
822842
* @param handler The sync set session model handler (returns plain value)
823843
* @return This builder for chaining
844+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
845+
* (June 2026). Use {@code session/set_config_option} with a {@code "model"} category
846+
* config option instead. Slated for removal.
824847
*/
848+
@Deprecated(forRemoval = true)
849+
@SuppressWarnings("removal")
825850
public SyncAgentBuilder setSessionModelHandler(SyncSetSessionModelHandler handler) {
826851
asyncBuilder.setSessionModelHandler(fromSync(handler));
827852
return this;
@@ -959,6 +984,8 @@ private static SetSessionModeHandler fromSync(SyncSetSessionModeHandler syncHand
959984
.subscribeOn(SYNC_HANDLER_SCHEDULER);
960985
}
961986

987+
@Deprecated(forRemoval = true)
988+
@SuppressWarnings("removal")
962989
private static SetSessionModelHandler fromSync(SyncSetSessionModelHandler syncHandler) {
963990
if (syncHandler == null) {
964991
return null;

acp-core/src/main/java/com/agentclientprotocol/sdk/agent/DefaultAcpAsyncAgent.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class DefaultAcpAsyncAgent implements AcpAsyncAgent {
5252

5353
private final AcpAgent.SetSessionModeHandler setSessionModeHandler;
5454

55+
@SuppressWarnings("removal")
5556
private final AcpAgent.SetSessionModelHandler setSessionModelHandler;
5657

5758
private final AcpAgent.ListSessionsHandler listSessionsHandler;
@@ -75,6 +76,7 @@ class DefaultAcpAsyncAgent implements AcpAsyncAgent {
7576
*/
7677
private final AtomicReference<NegotiatedCapabilities> clientCapabilities = new AtomicReference<>();
7778

79+
@SuppressWarnings("removal") // accepts the deprecated-for-removal SetSessionModelHandler
7880
DefaultAcpAsyncAgent(AcpAgentTransport transport, Duration requestTimeout,
7981
AcpAgent.InitializeHandler initializeHandler, AcpAgent.AuthenticateHandler authenticateHandler,
8082
AcpAgent.LogoutHandler logoutHandler, AcpAgent.NewSessionHandler newSessionHandler,
@@ -106,6 +108,7 @@ class DefaultAcpAsyncAgent implements AcpAsyncAgent {
106108
}
107109

108110
@Override
111+
@SuppressWarnings("removal") // registers the deprecated-for-removal session/set_model handler
109112
public Mono<Void> start() {
110113
return Mono.fromRunnable(() -> {
111114
logger.info("Starting ACP async agent");

acp-core/src/main/java/com/agentclientprotocol/sdk/client/AcpAsyncClient.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public class AcpAsyncClient {
102102
private static final TypeRef<AcpSchema.SetSessionModeResponse> SET_SESSION_MODE_RESPONSE_TYPE_REF = new TypeRef<>() {
103103
};
104104

105+
@SuppressWarnings("removal")
105106
private static final TypeRef<AcpSchema.SetSessionModelResponse> SET_SESSION_MODEL_RESPONSE_TYPE_REF = new TypeRef<>() {
106107
};
107108

@@ -343,7 +344,12 @@ public Mono<AcpSchema.SetSessionModeResponse> setSessionMode(AcpSchema.SetSessio
343344
* @param setModelRequest the set model request with session ID and desired model
344345
* @return a Mono emitting the response confirming the model change
345346
* @see AcpSchema#METHOD_SESSION_SET_MODEL
347+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
348+
* (June 2026). Use {@link #setSessionConfigOption} with a {@code "model"} category config
349+
* option instead. Slated for removal.
346350
*/
351+
@Deprecated(forRemoval = true)
352+
@SuppressWarnings("removal")
347353
public Mono<AcpSchema.SetSessionModelResponse> setSessionModel(AcpSchema.SetSessionModelRequest setModelRequest) {
348354
Assert.notNull(setModelRequest, "Set session model request must not be null");
349355
logger.debug("Setting session model: {} for session: {}", setModelRequest.modelId(),

acp-core/src/main/java/com/agentclientprotocol/sdk/client/AcpSyncClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ public AcpSchema.SetSessionModeResponse setSessionMode(AcpSchema.SetSessionModeR
255255
* @param setModelRequest the set model request with session ID and desired model
256256
* @return the response confirming the model change
257257
* @see AcpSchema#METHOD_SESSION_SET_MODEL
258+
* @deprecated The {@code session/set_model} method was removed from the ACP spec
259+
* (June 2026). Use {@link #setSessionConfigOption} with a {@code "model"} category config
260+
* option instead. Slated for removal.
258261
*/
262+
@Deprecated(forRemoval = true)
263+
@SuppressWarnings("removal")
259264
public AcpSchema.SetSessionModelResponse setSessionModel(AcpSchema.SetSessionModelRequest setModelRequest) {
260265
return this.delegate.setSessionModel(setModelRequest).block();
261266
}

0 commit comments

Comments
 (0)