Skip to content

Commit 6199969

Browse files
lramos15Copilot
andcommitted
models: keep model IDs stable across catalog updates
A saved selection holds only a model ID, so hosts must not reuse an ID for a different source or upstream model, even after the model leaves the catalog. A saved ID that is no longer listed is unavailable. Co-authored-by: Copilot <[email protected]>
1 parent b645f8f commit 6199969

13 files changed

Lines changed: 19 additions & 12 deletions

File tree

‎clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2228,7 +2228,8 @@ public sealed record SessionModelInfo
22282228
{
22292229
/// <summary>Model identifier, unique within the agent's {@link AgentInfo.models}.
22302230
/// When several model sources serve the same upstream model, the host gives
2231-
/// each entry its own ID.</summary>
2231+
/// each entry its own ID. A host SHOULD keep a model's ID across catalog
2232+
/// updates and MUST NOT reuse an ID for a different source or upstream model.</summary>
22322233
public required string Id { get; init; }
22332234

22342235
/// <summary>Agent provider that owns this model. Matches {@link AgentInfo.provider}.</summary>

‎clients/go/ahptypes/state.generated.go‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ type ModelSourceInfo struct {
922922
type SessionModelInfo struct {
923923
// Model identifier, unique within the agent's {@link AgentInfo.models}.
924924
// When several model sources serve the same upstream model, the host gives
925-
// each entry its own ID.
925+
// each entry its own ID. A host SHOULD keep a model's ID across catalog
926+
// updates and MUST NOT reuse an ID for a different source or upstream model.
926927
Id string `json:"id"`
927928
// Agent provider that owns this model. Matches {@link AgentInfo.provider}.
928929
Provider string `json:"provider"`

‎clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,8 @@ data class SessionModelInfo(
17011701
/**
17021702
* Model identifier, unique within the agent's {@link AgentInfo.models}.
17031703
* When several model sources serve the same upstream model, the host gives
1704-
* each entry its own ID.
1704+
* each entry its own ID. A host SHOULD keep a model's ID across catalog
1705+
* updates and MUST NOT reuse an ID for a different source or upstream model.
17051706
*/
17061707
val id: String,
17071708
/**

‎clients/rust/crates/ahp-types/src/state.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2022,7 +2022,8 @@ pub struct ModelSourceInfo {
20222022
pub struct SessionModelInfo {
20232023
/// Model identifier, unique within the agent's {@link AgentInfo.models}.
20242024
/// When several model sources serve the same upstream model, the host gives
2025-
/// each entry its own ID.
2025+
/// each entry its own ID. A host SHOULD keep a model's ID across catalog
2026+
/// updates and MUST NOT reuse an ID for a different source or upstream model.
20262027
pub id: String,
20272028
/// Agent provider that owns this model. Matches {@link AgentInfo.provider}.
20282029
pub provider: String,

‎clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1702,7 +1702,8 @@ public struct ModelSourceInfo: Codable, Sendable, Equatable {
17021702
public struct SessionModelInfo: Codable, Sendable, Equatable {
17031703
/// Model identifier, unique within the agent's {@link AgentInfo.models}.
17041704
/// When several model sources serve the same upstream model, the host gives
1705-
/// each entry its own ID.
1705+
/// each entry its own ID. A host SHOULD keep a model's ID across catalog
1706+
/// updates and MUST NOT reuse an ID for a different source or upstream model.
17061707
public var id: String
17071708
/// Agent provider that owns this model. Matches {@link AgentInfo.provider}.
17081709
public var provider: String
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"type": "added",
3-
"message": "`ModelSourceInfo`, `AgentInfo.modelSources`, and `SessionModelInfo.modelSourceId` let an agent label and group its models by source."
3+
"message": "`ModelSourceInfo`, `AgentInfo.modelSources`, and `SessionModelInfo.modelSourceId` let an agent label and group its models by source. Model IDs are unique within an agent and stable across catalog updates."
44
}

‎docs/specification/root-channel.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ An agent provider can offer models from more than one source, such as different
3939
- Source IDs MUST be unique within the agent's `modelSources`.
4040
- A model's `modelSourceId` MUST match an entry in the same agent's `modelSources`.
4141
- Model IDs MUST be unique within the agent's `models`. When two sources serve the same upstream model, the host gives each entry its own ID and maps that ID to the upstream model.
42+
- Model IDs are stable. A host SHOULD keep a model's ID across catalog updates, so saved selections keep working. It MUST NOT reuse an ID for a different source or upstream model, even after the model leaves `models`. A saved selection whose ID is no longer in `models` is unavailable.
4243
- A source can have no models.
4344

4445
A [`ModelSelection`](/reference/root#modelselection) names a model by its `id`, which also determines the source.

‎schema/actions.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3411,7 +3411,7 @@
34113411
"properties": {
34123412
"id": {
34133413
"type": "string",
3414-
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID."
3414+
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID. A host SHOULD keep a model's ID across catalog\nupdates and MUST NOT reuse an ID for a different source or upstream model."
34153415
},
34163416
"provider": {
34173417
"type": "string",

‎schema/commands.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2771,7 +2771,7 @@
27712771
"properties": {
27722772
"id": {
27732773
"type": "string",
2774-
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID."
2774+
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID. A host SHOULD keep a model's ID across catalog\nupdates and MUST NOT reuse an ID for a different source or upstream model."
27752775
},
27762776
"provider": {
27772777
"type": "string",

‎schema/errors.schema.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@
780780
"properties": {
781781
"id": {
782782
"type": "string",
783-
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID."
783+
"description": "Model identifier, unique within the agent's {@link AgentInfo.models}.\nWhen several model sources serve the same upstream model, the host gives\neach entry its own ID. A host SHOULD keep a model's ID across catalog\nupdates and MUST NOT reuse an ID for a different source or upstream model."
784784
},
785785
"provider": {
786786
"type": "string",

0 commit comments

Comments
 (0)