Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2001,6 +2001,88 @@ abstract class SimpleAgentTest(protocolDriver: ProtocolDriver) : ProtocolDriver
assertEquals(1, sessions.size)
}

@OptIn(UnstableApi::class)
@Test
fun `providers capability and methods are wired through client api`() = testWithProtocols { clientProtocol, agentProtocol ->
var lastSetProvider: SetProvidersRequest? = null
var lastDisabledProviderId: String? = null

val client = Client(protocol = clientProtocol)
Agent(protocol = agentProtocol, agentSupport = object : AgentSupport {
override suspend fun initialize(clientInfo: ClientInfo): AgentInfo {
return AgentInfo(
clientInfo.protocolVersion,
capabilities = AgentCapabilities(providers = ProvidersCapabilities())
)
}

override suspend fun listProviders(_meta: JsonElement?): ListProvidersResponse {
return ListProvidersResponse(
providers = listOf(
ProviderInfo(
id = "main",
supported = listOf(LlmProtocol.OPENAI, LlmProtocol.ANTHROPIC),
required = false,
current = ProviderCurrentConfig(
apiType = LlmProtocol.OPENAI,
baseUrl = "https://api.openai.com/v1"
)
),
ProviderInfo(
id = "backup",
supported = listOf(LlmProtocol.OPENAI),
required = false
)
)
)
}

override suspend fun setProvider(
id: String,
apiType: LlmProtocol,
baseUrl: String,
headers: Map<String, String>?,
_meta: JsonElement?
): SetProvidersResponse {
lastSetProvider = SetProvidersRequest(id, apiType, baseUrl, headers, _meta)
return SetProvidersResponse()
}

override suspend fun disableProvider(id: String, _meta: JsonElement?): DisableProvidersResponse {
lastDisabledProviderId = id
return DisableProvidersResponse()
}

override suspend fun createSession(sessionParameters: SessionCreationParameters): AgentSession {
TODO("Not needed for providers test")
}
})

val agentInfo = client.initialize(ClientInfo(protocolVersion = LATEST_PROTOCOL_VERSION))
assertNotNull(agentInfo.capabilities.providers)

val providersResponse = client.listProviders()
assertEquals(2, providersResponse.providers.size)
assertEquals("main", providersResponse.providers[0].id)
assertEquals(LlmProtocol.OPENAI, providersResponse.providers[0].current?.apiType)
assertNull(providersResponse.providers[1].current)

client.setProvider(
id = "main",
apiType = LlmProtocol.ANTHROPIC,
baseUrl = "https://api.anthropic.com",
headers = mapOf("x-api-key" to "test-key")
)
assertNotNull(lastSetProvider)
assertEquals("main", lastSetProvider.id)
assertEquals(LlmProtocol.ANTHROPIC, lastSetProvider.apiType)
assertEquals("https://api.anthropic.com", lastSetProvider.baseUrl)
assertEquals("test-key", lastSetProvider.headers?.get("x-api-key"))

client.disableProvider("main")
assertEquals("main", lastDisabledProviderId)
}

@Test
@OptIn(UnstableApi::class)
fun `session ready notifies available commands`() = testWithProtocols { clientProtocol, agentProtocol ->
Expand Down
8 changes: 4 additions & 4 deletions acp-model/.schema-checksums
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
# Format: SHA256 FILENAME

# Stable schemas
07f2cdfd7814496ebdab83fb7417787fa1dddc6276b11cd31b51be2f8ba95f2b schema/schema.json
f242b95def9a9cbfddd2db1a45d8d3d489ad1b4f564a1322547c90a94c647637 schema/meta.json
38751907a86016c73662ea2ad1ded2c8cbbdb99fe40b8368b6dd2794726be236 schema/schema.json
71036d4c70f1e964c445569c1878a513e2fadfc797161d7582224b4647669330 schema/meta.json

# Unstable schemas
75d180b9c589cd7d79a5a9cbb6680d52e1bce71238839871441d30c753b497a9 schema/schema.unstable.json
e87ae9b3fc3b05f88da6dfc06d003e5263d6a041b1c934ed13b83173b39ed111 schema/meta.unstable.json
cb3cf31dae7e482dc45389f15e23edff037abaeccbffbe3b6d8eb1f9c00b88a5 schema/schema.unstable.json
0a030d3641d0cbc71c433fc2ef68e33ee3c5707220c3ceb662ccb2e6f656e026 schema/meta.unstable.json
2 changes: 1 addition & 1 deletion acp-model/.schema-revision
Original file line number Diff line number Diff line change
@@ -1 +1 @@
37d12f4bb4b0cf1dca60421d48cb17decc119b8e
a26839cc3ab0a746eff1fb95a02e87a5946ad631
48 changes: 23 additions & 25 deletions acp-model/SCHEMA_VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,65 +5,63 @@ This file tracks the version of the Agent Client Protocol schema that the model
## Schema Source
- Repository: https://github.com/agentclientprotocol/agent-client-protocol
- Branch: main
- Release: v0.9.1
- Baseline commit: `a26839cc3ab0a746eff1fb95a02e87a5946ad631`
- Baseline commit date: 2026-04-19 12:29:33 +0100
- Baseline commit subject: `Optional current provider (#1021)`

## Schema Files

### Stable Schema
- **schema.json**
- Commit: `37d12f4bb4b0cf1dca60421d48cb17decc119b8e`
- Date: 2025-12-20 18:25:51 +0000
- SHA256: `07f2cdfd7814496ebdab83fb7417787fa1dddc6276b11cd31b51be2f8ba95f2b`
- Commit: `a26839cc3ab0a746eff1fb95a02e87a5946ad631`
- Date: 2026-04-19 12:29:33 +0100
- SHA256: `38751907a86016c73662ea2ad1ded2c8cbbdb99fe40b8368b6dd2794726be236`
- URL: https://github.com/agentclientprotocol/agent-client-protocol/blob/main/schema/schema.json

- **meta.json**
- Commit: `37d12f4bb4b0cf1dca60421d48cb17decc119b8e`
- Date: 2025-12-20 18:25:51 +0000
- SHA256: `f242b95def9a9cbfddd2db1a45d8d3d489ad1b4f564a1322547c90a94c647637`
- Commit: `a26839cc3ab0a746eff1fb95a02e87a5946ad631`
- Date: 2026-04-19 12:29:33 +0100
- SHA256: `71036d4c70f1e964c445569c1878a513e2fadfc797161d7582224b4647669330`
- URL: https://github.com/agentclientprotocol/agent-client-protocol/blob/main/schema/meta.json

### Unstable Schema
- **schema.unstable.json**
- Commit: `37d12f4bb4b0cf1dca60421d48cb17decc119b8e`
- Date: 2025-12-20 18:25:51 +0000
- SHA256: `75d180b9c589cd7d79a5a9cbb6680d52e1bce71238839871441d30c753b497a9`
- Commit: `a26839cc3ab0a746eff1fb95a02e87a5946ad631`
- Date: 2026-04-19 12:29:33 +0100
- SHA256: `cb3cf31dae7e482dc45389f15e23edff037abaeccbffbe3b6d8eb1f9c00b88a5`
- URL: https://github.com/agentclientprotocol/agent-client-protocol/blob/main/schema/schema.unstable.json

- **meta.unstable.json**
- Commit: `37d12f4bb4b0cf1dca60421d48cb17decc119b8e`
- Date: 2025-12-20 18:25:51 +0000
- SHA256: `e87ae9b3fc3b05f88da6dfc06d003e5263d6a041b1c934ed13b83173b39ed111`
- Commit: `a26839cc3ab0a746eff1fb95a02e87a5946ad631`
- Date: 2026-04-19 12:29:33 +0100
- SHA256: `0a030d3641d0cbc71c433fc2ef68e33ee3c5707220c3ceb662ccb2e6f656e026`
- URL: https://github.com/agentclientprotocol/agent-client-protocol/blob/main/schema/meta.unstable.json

**Note:** All types from unstable schema must be marked with `@UnstableApi` annotation.

## Last Updated
- Date: 2025-12-20
- Date: 2026-04-19
- Updated by: Manual schema synchronization

## Changes in This Version
- Added `session/fork` method to agent methods (unstable)
- Added `session/list` method to agent methods (unstable)
- Added `session/resume` method to agent methods (unstable)
- Added `session/set_config_option` method to agent methods (unstable)
- Added `session/set_model` method to agent methods (unstable)
- Added `$/cancel_request` protocol method (unstable)
- Updated stable schema with bug fixes and improvements
- `ProviderInfo.current` is optional now (`required` no longer includes `current`).
- Disabled provider is valid both when `current` is omitted and when it is explicitly `null`.
- Unstable providers schema (`providers/list`, `providers/set`, `providers/disable`) is synced to current `main` HEAD.

## Verification
To verify the schema files match:
```bash
# Stable schemas
curl -s https://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/schema.json | sha256sum
# Expected: 07f2cdfd7814496ebdab83fb7417787fa1dddc6276b11cd31b51be2f8ba95f2b
# Expected: 38751907a86016c73662ea2ad1ded2c8cbbdb99fe40b8368b6dd2794726be236

curl -s https://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/meta.json | sha256sum
# Expected: f242b95def9a9cbfddd2db1a45d8d3d489ad1b4f564a1322547c90a94c647637
# Expected: 71036d4c70f1e964c445569c1878a513e2fadfc797161d7582224b4647669330

# Unstable schemas
curl -s https://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/schema.unstable.json | sha256sum
# Expected: 75d180b9c589cd7d79a5a9cbb6680d52e1bce71238839871441d30c753b497a9
# Expected: cb3cf31dae7e482dc45389f15e23edff037abaeccbffbe3b6d8eb1f9c00b88a5

curl -s https://raw.githubusercontent.com/agentclientprotocol/agent-client-protocol/main/schema/meta.unstable.json | sha256sum
# Expected: e87ae9b3fc3b05f88da6dfc06d003e5263d6a041b1c934ed13b83173b39ed111
# Expected: 0a030d3641d0cbc71c433fc2ef68e33ee3c5707220c3ceb662ccb2e6f656e026
```
Loading
Loading