From b65d0d7f9c424a20bd8bf121f670a24617bcb24b Mon Sep 17 00:00:00 2001 From: "Vladislav.Ertel" Date: Thu, 26 Nov 2026 23:26:34 +0000 Subject: [PATCH 1/3] root: add optional icons and _meta to AgentInfo Clients that show agents, for example in an agent picker, have no typed place to read an agent's icon from RootState.agents, and AgentInfo has no _meta either. Add AgentInfo.icons, reusing the Icon shape that customizations and model sources already carry, so the standard root/agentsChanged carries icons and their updates. Add an optional AgentInfo._meta, as on SessionModelInfo and ModelSource, for implementation-defined agent metadata. Co-Authored-By: Claude Opus 5.5 --- .../Generated/State.generated.cs | 12 +++ clients/go/ahptypes/state.generated.go | 7 ++ .../generated/State.generated.kt | 14 +++- clients/rust/crates/ahp-types/src/state.rs | 9 +++ .../rust/crates/ahp/examples/reducers_demo.rs | 2 + clients/rust/crates/ahp/tests/hosts.rs | 2 + .../ahp/tests/multi_host_state_mirror.rs | 2 + .../Generated/State.generated.swift | 25 +++++- docs/.changes/20261126-agent-info-icons.json | 4 + docs/guide/actions.md | 2 +- docs/guide/state-model.md | 1 + docs/specification/root-channel.md | 2 +- schema/actions.schema.json | 12 +++ schema/commands.schema.json | 12 +++ schema/errors.schema.json | 12 +++ schema/notifications.schema.json | 12 +++ schema/state.schema.json | 12 +++ types/channels-root/state.ts | 11 +++ .../round-trips/119-agent-info-icons.json | 76 +++++++++++++++++++ 19 files changed, 225 insertions(+), 4 deletions(-) create mode 100644 docs/.changes/20261126-agent-info-icons.json create mode 100644 types/test-cases/round-trips/119-agent-info-icons.json diff --git a/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs b/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs index d98720548..7dc022809 100644 --- a/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs +++ b/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs @@ -2542,6 +2542,18 @@ public sealed record AgentInfo /// id. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public AgentCapabilities? Capabilities { get; init; } + + /// Icons for UI display, such as in an agent picker. When an agent's icons + /// change, the host dispatches `root/agentsChanged` with the new icons. + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public List? Icons { get; init; } + + /// Additional implementation-defined metadata for this agent. + /// + /// Clients MAY look for well-known keys here to provide enhanced UI. + [JsonPropertyName("_meta")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public Dictionary? Meta { get; init; } } /// Static capabilities an {@link AgentInfo} advertises. Modelled after MCP diff --git a/clients/go/ahptypes/state.generated.go b/clients/go/ahptypes/state.generated.go index 7e66b2ac1..12c18ee03 100644 --- a/clients/go/ahptypes/state.generated.go +++ b/clients/go/ahptypes/state.generated.go @@ -940,6 +940,13 @@ type AgentInfo struct { // to gate features (multi-chat, fork) instead of switching on the provider // id. Capabilities *AgentCapabilities `json:"capabilities,omitempty"` + // Icons for UI display, such as in an agent picker. When an agent's icons + // change, the host dispatches `root/agentsChanged` with the new icons. + Icons []Icon `json:"icons,omitempty"` + // Additional implementation-defined metadata for this agent. + // + // Clients MAY look for well-known keys here to provide enhanced UI. + Meta map[string]json.RawMessage `json:"_meta,omitempty"` } // Static capabilities an {@link AgentInfo} advertises. Modelled after MCP diff --git a/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt b/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt index b115aacc3..58ca77e8d 100644 --- a/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt +++ b/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt @@ -1843,7 +1843,19 @@ data class AgentInfo( * to gate features (multi-chat, fork) instead of switching on the provider * id. */ - val capabilities: AgentCapabilities? = null + val capabilities: AgentCapabilities? = null, + /** + * Icons for UI display, such as in an agent picker. When an agent's icons + * change, the host dispatches `root/agentsChanged` with the new icons. + */ + val icons: List? = null, + /** + * Additional implementation-defined metadata for this agent. + * + * Clients MAY look for well-known keys here to provide enhanced UI. + */ + @SerialName("_meta") + val meta: Map? = null ) @Serializable diff --git a/clients/rust/crates/ahp-types/src/state.rs b/clients/rust/crates/ahp-types/src/state.rs index acf7c00fe..3a9064047 100644 --- a/clients/rust/crates/ahp-types/src/state.rs +++ b/clients/rust/crates/ahp-types/src/state.rs @@ -2240,6 +2240,15 @@ pub struct AgentInfo { /// id. #[serde(default, skip_serializing_if = "Option::is_none")] pub capabilities: Option, + /// Icons for UI display, such as in an agent picker. When an agent's icons + /// change, the host dispatches `root/agentsChanged` with the new icons. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub icons: Option>, + /// Additional implementation-defined metadata for this agent. + /// + /// Clients MAY look for well-known keys here to provide enhanced UI. + #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, } /// Static capabilities an {@link AgentInfo} advertises. Modelled after MCP diff --git a/clients/rust/crates/ahp/examples/reducers_demo.rs b/clients/rust/crates/ahp/examples/reducers_demo.rs index e28c0255f..030d53a34 100644 --- a/clients/rust/crates/ahp/examples/reducers_demo.rs +++ b/clients/rust/crates/ahp/examples/reducers_demo.rs @@ -39,6 +39,8 @@ fn main() { protected_resources: None, customizations: None, capabilities: None, + icons: None, + meta: None, }], }), server_seq: 1, diff --git a/clients/rust/crates/ahp/tests/hosts.rs b/clients/rust/crates/ahp/tests/hosts.rs index 0b9cdc675..4e82c771b 100644 --- a/clients/rust/crates/ahp/tests/hosts.rs +++ b/clients/rust/crates/ahp/tests/hosts.rs @@ -243,6 +243,8 @@ async fn single_constructor_yields_connected_handle() { protected_resources: None, customizations: None, capabilities: None, + icons: None, + meta: None, }; let state = FakeHostState::new().with_agents(vec![agent.clone()]); let factory = make_basic_factory(state); diff --git a/clients/rust/crates/ahp/tests/multi_host_state_mirror.rs b/clients/rust/crates/ahp/tests/multi_host_state_mirror.rs index b54692316..c6dc587d1 100644 --- a/clients/rust/crates/ahp/tests/multi_host_state_mirror.rs +++ b/clients/rust/crates/ahp/tests/multi_host_state_mirror.rs @@ -31,6 +31,8 @@ fn agent(provider: &str) -> AgentInfo { protected_resources: None, customizations: None, capabilities: None, + icons: None, + meta: None, } } diff --git a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift index cf5473224..0ef4c4ba2 100644 --- a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift +++ b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift @@ -1833,6 +1833,25 @@ public struct AgentInfo: Codable, Sendable, Equatable { /// to gate features (multi-chat, fork) instead of switching on the provider /// id. public var capabilities: AgentCapabilities? + /// Icons for UI display, such as in an agent picker. When an agent's icons + /// change, the host dispatches `root/agentsChanged` with the new icons. + public var icons: [Icon]? + /// Additional implementation-defined metadata for this agent. + /// + /// Clients MAY look for well-known keys here to provide enhanced UI. + public var meta: [String: AnyCodable]? + + enum CodingKeys: String, CodingKey { + case provider + case displayName + case description + case models + case protectedResources + case customizations + case capabilities + case icons + case meta = "_meta" + } public init( provider: String, @@ -1841,7 +1860,9 @@ public struct AgentInfo: Codable, Sendable, Equatable { models: [SessionModelInfo], protectedResources: [ProtectedResourceMetadata]? = nil, customizations: [Customization]? = nil, - capabilities: AgentCapabilities? = nil + capabilities: AgentCapabilities? = nil, + icons: [Icon]? = nil, + meta: [String: AnyCodable]? = nil ) { self.provider = provider self.displayName = displayName @@ -1850,6 +1871,8 @@ public struct AgentInfo: Codable, Sendable, Equatable { self.protectedResources = protectedResources self.customizations = customizations self.capabilities = capabilities + self.icons = icons + self.meta = meta } } diff --git a/docs/.changes/20261126-agent-info-icons.json b/docs/.changes/20261126-agent-info-icons.json new file mode 100644 index 000000000..3350f6690 --- /dev/null +++ b/docs/.changes/20261126-agent-info-icons.json @@ -0,0 +1,4 @@ +{ + "type": "added", + "message": "Add optional `AgentInfo.icons` so clients can show each agent's icon, for example in an agent picker, straight from `RootState.agents`; hosts dispatch `root/agentsChanged` when an agent's icons change. Also add an optional `AgentInfo._meta` for implementation-defined agent metadata." +} diff --git a/docs/guide/actions.md b/docs/guide/actions.md index 7cd8b5b7e..0a824d12f 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -27,7 +27,7 @@ These mutate root state and travel on the [Root Channel](/specification/root-cha | Type | Client-dispatchable? | When | |---|---|---| -| `root/agentsChanged` | No | Available agent backends or their models changed | +| `root/agentsChanged` | No | Available agent backends, their models, or their icons changed | | `root/activeSessionsChanged` | No | Count of active sessions changed | | `root/terminalsChanged` | No | Lightweight terminal catalogue changed (full replacement) | | `root/configChanged` | **Yes** | Host-level configuration values changed | diff --git a/docs/guide/state-model.md b/docs/guide/state-model.md index 125cc1ead..acbdba38b 100644 --- a/docs/guide/state-model.md +++ b/docs/guide/state-model.md @@ -25,6 +25,7 @@ AgentInfo { description: string models: SessionModelInfo[] customizations?: Customization[] // Open Plugins + icons?: Icon[] } SessionModelInfo { diff --git a/docs/specification/root-channel.md b/docs/specification/root-channel.md index 200791682..a826b0392 100644 --- a/docs/specification/root-channel.md +++ b/docs/specification/root-channel.md @@ -26,7 +26,7 @@ RootState { } ``` -- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). +- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent MAY carry `icons` for display; when an agent's icons change, the host dispatches `root/agentsChanged` with the new icons. - `activeSessions` — count of non-disposed sessions. Lightweight badge counter. - `terminals` — lightweight per-terminal metadata for rendering a terminal manager UI without subscribing to every terminal. See [Terminal Channel](/specification/terminal-channel) for the full state. - `config` — host-level configuration schema and current values. diff --git a/schema/actions.schema.json b/schema/actions.schema.json index b167f0db8..85bc4c4e0 100644 --- a/schema/actions.schema.json +++ b/schema/actions.schema.json @@ -3511,6 +3511,18 @@ "capabilities": { "$ref": "#/$defs/AgentCapabilities", "description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid." + }, + "icons": { + "type": "array", + "items": { + "$ref": "#/$defs/Icon" + }, + "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/commands.schema.json b/schema/commands.schema.json index 34ebf8189..36a9958b9 100644 --- a/schema/commands.schema.json +++ b/schema/commands.schema.json @@ -2808,6 +2808,18 @@ "capabilities": { "$ref": "#/$defs/AgentCapabilities", "description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid." + }, + "icons": { + "type": "array", + "items": { + "$ref": "#/$defs/Icon" + }, + "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/errors.schema.json b/schema/errors.schema.json index 65291adba..93dd7821b 100644 --- a/schema/errors.schema.json +++ b/schema/errors.schema.json @@ -714,6 +714,18 @@ "capabilities": { "$ref": "#/$defs/AgentCapabilities", "description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid." + }, + "icons": { + "type": "array", + "items": { + "$ref": "#/$defs/Icon" + }, + "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/notifications.schema.json b/schema/notifications.schema.json index a685e14c9..a62886ae1 100644 --- a/schema/notifications.schema.json +++ b/schema/notifications.schema.json @@ -1015,6 +1015,18 @@ "capabilities": { "$ref": "#/$defs/AgentCapabilities", "description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid." + }, + "icons": { + "type": "array", + "items": { + "$ref": "#/$defs/Icon" + }, + "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/state.schema.json b/schema/state.schema.json index b0370ee33..fec2389b9 100644 --- a/schema/state.schema.json +++ b/schema/state.schema.json @@ -624,6 +624,18 @@ "capabilities": { "$ref": "#/$defs/AgentCapabilities", "description": "Static capabilities the agent advertises about itself. Clients use these\nto gate features (multi-chat, fork) instead of switching on the provider\nid." + }, + "icons": { + "type": "array", + "items": { + "$ref": "#/$defs/Icon" + }, + "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/types/channels-root/state.ts b/types/channels-root/state.ts index 6bee745d5..33e21bfab 100644 --- a/types/channels-root/state.ts +++ b/types/channels-root/state.ts @@ -105,6 +105,17 @@ export interface AgentInfo { * id. */ capabilities?: AgentCapabilities; + /** + * Icons for UI display, such as in an agent picker. When an agent's icons + * change, the host dispatches `root/agentsChanged` with the new icons. + */ + icons?: Icon[]; + /** + * Additional implementation-defined metadata for this agent. + * + * Clients MAY look for well-known keys here to provide enhanced UI. + */ + _meta?: Record; } /** diff --git a/types/test-cases/round-trips/119-agent-info-icons.json b/types/test-cases/round-trips/119-agent-info-icons.json new file mode 100644 index 000000000..740fd9b6f --- /dev/null +++ b/types/test-cases/round-trips/119-agent-info-icons.json @@ -0,0 +1,76 @@ +{ + "name": "agent-info-icons", + "group": "A", + "description": "AgentInfo.icons and AgentInfo._meta are optional. One agent carries a light and a dark icon plus metadata, the other has neither. Pins that icons and metadata survive a decode/re-encode cycle in root/agentsChanged and that absent fields stay absent instead of re-encoding as null.", + "type": "StateAction", + "input": { + "type": "root/agentsChanged", + "agents": [ + { + "provider": "example", + "displayName": "Example", + "description": "An agent with themed icons.", + "models": [], + "icons": [ + { + "src": "https://example.com/icons/example-light.png", + "contentType": "image/png", + "sizes": ["96x96"], + "theme": "light" + }, + { + "src": "https://example.com/icons/example-dark.png", + "contentType": "image/png", + "sizes": ["96x96"], + "theme": "dark" + } + ], + "_meta": { + "example.com/badge": "beta" + } + }, + { + "provider": "plain", + "displayName": "Plain", + "description": "An agent without icons.", + "models": [] + } + ] + }, + "acceptableOutputs": [ + { + "type": "root/agentsChanged", + "agents": [ + { + "provider": "example", + "displayName": "Example", + "description": "An agent with themed icons.", + "models": [], + "icons": [ + { + "src": "https://example.com/icons/example-light.png", + "contentType": "image/png", + "sizes": ["96x96"], + "theme": "light" + }, + { + "src": "https://example.com/icons/example-dark.png", + "contentType": "image/png", + "sizes": ["96x96"], + "theme": "dark" + } + ], + "_meta": { + "example.com/badge": "beta" + } + }, + { + "provider": "plain", + "displayName": "Plain", + "description": "An agent without icons.", + "models": [] + } + ] + } + ] +} From 379d5f19370cd243de86a4a22dc33e229cc06287 Mon Sep 17 00:00:00 2001 From: "Vladislav.Ertel" Date: Thu, 26 Nov 2026 23:34:18 +0000 Subject: [PATCH 2/3] root: trim AgentInfo.icons docs and note the Rust literal change root/agentsChanged already replaces agents whole, so the icons field needs no update rule of its own; drop the sentence that implied one and restore the actions guide row. Give AgentInfo._meta the same credential guard as ModelSource._meta, list it in the state model sketch, shorten the changelog entry, and add a Rust migration note for AgentInfo struct literals. Co-Authored-By: Claude Opus 5.5 --- .../Generated/State.generated.cs | 4 ++-- clients/go/ahptypes/state.generated.go | 4 ++-- .../agenthostprotocol/generated/State.generated.kt | 4 ++-- clients/rust/crates/ahp-types/src/state.rs | 4 ++-- .../AgentHostProtocol/Generated/State.generated.swift | 4 ++-- docs/.changes/20261126-agent-info-icons-migration.json | 5 +++++ docs/.changes/20261126-agent-info-icons.json | 2 +- docs/guide/actions.md | 2 +- docs/guide/state-model.md | 1 + docs/specification/root-channel.md | 2 +- schema/actions.schema.json | 4 ++-- schema/commands.schema.json | 4 ++-- schema/errors.schema.json | 4 ++-- schema/notifications.schema.json | 4 ++-- schema/state.schema.json | 4 ++-- types/channels-root/state.ts | 6 ++---- 16 files changed, 31 insertions(+), 27 deletions(-) create mode 100644 docs/.changes/20261126-agent-info-icons-migration.json diff --git a/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs b/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs index 7dc022809..25b3a1c37 100644 --- a/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs +++ b/clients/dotnet/src/AgentHostProtocol.Abstractions/Generated/State.generated.cs @@ -2543,12 +2543,12 @@ public sealed record AgentInfo [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public AgentCapabilities? Capabilities { get; init; } - /// Icons for UI display, such as in an agent picker. When an agent's icons - /// change, the host dispatches `root/agentsChanged` with the new icons. + /// Icons for UI display, such as in an agent picker. [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public List? Icons { get; init; } /// Additional implementation-defined metadata for this agent. + /// MUST NOT contain a credential. /// /// Clients MAY look for well-known keys here to provide enhanced UI. [JsonPropertyName("_meta")] diff --git a/clients/go/ahptypes/state.generated.go b/clients/go/ahptypes/state.generated.go index 12c18ee03..cb3df1e0e 100644 --- a/clients/go/ahptypes/state.generated.go +++ b/clients/go/ahptypes/state.generated.go @@ -940,10 +940,10 @@ type AgentInfo struct { // to gate features (multi-chat, fork) instead of switching on the provider // id. Capabilities *AgentCapabilities `json:"capabilities,omitempty"` - // Icons for UI display, such as in an agent picker. When an agent's icons - // change, the host dispatches `root/agentsChanged` with the new icons. + // Icons for UI display, such as in an agent picker. Icons []Icon `json:"icons,omitempty"` // Additional implementation-defined metadata for this agent. + // MUST NOT contain a credential. // // Clients MAY look for well-known keys here to provide enhanced UI. Meta map[string]json.RawMessage `json:"_meta,omitempty"` diff --git a/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt b/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt index 58ca77e8d..162640dc7 100644 --- a/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt +++ b/clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt @@ -1845,12 +1845,12 @@ data class AgentInfo( */ val capabilities: AgentCapabilities? = null, /** - * Icons for UI display, such as in an agent picker. When an agent's icons - * change, the host dispatches `root/agentsChanged` with the new icons. + * Icons for UI display, such as in an agent picker. */ val icons: List? = null, /** * Additional implementation-defined metadata for this agent. + * MUST NOT contain a credential. * * Clients MAY look for well-known keys here to provide enhanced UI. */ diff --git a/clients/rust/crates/ahp-types/src/state.rs b/clients/rust/crates/ahp-types/src/state.rs index 3a9064047..482e9aaa7 100644 --- a/clients/rust/crates/ahp-types/src/state.rs +++ b/clients/rust/crates/ahp-types/src/state.rs @@ -2240,11 +2240,11 @@ pub struct AgentInfo { /// id. #[serde(default, skip_serializing_if = "Option::is_none")] pub capabilities: Option, - /// Icons for UI display, such as in an agent picker. When an agent's icons - /// change, the host dispatches `root/agentsChanged` with the new icons. + /// Icons for UI display, such as in an agent picker. #[serde(default, skip_serializing_if = "Option::is_none")] pub icons: Option>, /// Additional implementation-defined metadata for this agent. + /// MUST NOT contain a credential. /// /// Clients MAY look for well-known keys here to provide enhanced UI. #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")] diff --git a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift index 0ef4c4ba2..4fc80f7e8 100644 --- a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift +++ b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift @@ -1833,10 +1833,10 @@ public struct AgentInfo: Codable, Sendable, Equatable { /// to gate features (multi-chat, fork) instead of switching on the provider /// id. public var capabilities: AgentCapabilities? - /// Icons for UI display, such as in an agent picker. When an agent's icons - /// change, the host dispatches `root/agentsChanged` with the new icons. + /// Icons for UI display, such as in an agent picker. public var icons: [Icon]? /// Additional implementation-defined metadata for this agent. + /// MUST NOT contain a credential. /// /// Clients MAY look for well-known keys here to provide enhanced UI. public var meta: [String: AnyCodable]? diff --git a/docs/.changes/20261126-agent-info-icons-migration.json b/docs/.changes/20261126-agent-info-icons-migration.json new file mode 100644 index 000000000..24753bd9f --- /dev/null +++ b/docs/.changes/20261126-agent-info-icons-migration.json @@ -0,0 +1,5 @@ +{ + "type": "changed", + "message": "Direct Rust struct literals for `AgentInfo` must now include `icons: None` and `meta: None`.", + "targets": ["rust"] +} diff --git a/docs/.changes/20261126-agent-info-icons.json b/docs/.changes/20261126-agent-info-icons.json index 3350f6690..a4f88dc69 100644 --- a/docs/.changes/20261126-agent-info-icons.json +++ b/docs/.changes/20261126-agent-info-icons.json @@ -1,4 +1,4 @@ { "type": "added", - "message": "Add optional `AgentInfo.icons` so clients can show each agent's icon, for example in an agent picker, straight from `RootState.agents`; hosts dispatch `root/agentsChanged` when an agent's icons change. Also add an optional `AgentInfo._meta` for implementation-defined agent metadata." + "message": "Add optional `AgentInfo.icons` so clients can show agent icons from root state, and an optional `AgentInfo._meta` for implementation-defined agent metadata." } diff --git a/docs/guide/actions.md b/docs/guide/actions.md index 0a824d12f..7cd8b5b7e 100644 --- a/docs/guide/actions.md +++ b/docs/guide/actions.md @@ -27,7 +27,7 @@ These mutate root state and travel on the [Root Channel](/specification/root-cha | Type | Client-dispatchable? | When | |---|---|---| -| `root/agentsChanged` | No | Available agent backends, their models, or their icons changed | +| `root/agentsChanged` | No | Available agent backends or their models changed | | `root/activeSessionsChanged` | No | Count of active sessions changed | | `root/terminalsChanged` | No | Lightweight terminal catalogue changed (full replacement) | | `root/configChanged` | **Yes** | Host-level configuration values changed | diff --git a/docs/guide/state-model.md b/docs/guide/state-model.md index acbdba38b..3b16f0540 100644 --- a/docs/guide/state-model.md +++ b/docs/guide/state-model.md @@ -26,6 +26,7 @@ AgentInfo { models: SessionModelInfo[] customizations?: Customization[] // Open Plugins icons?: Icon[] + _meta?: Record } SessionModelInfo { diff --git a/docs/specification/root-channel.md b/docs/specification/root-channel.md index a826b0392..a3098c9c1 100644 --- a/docs/specification/root-channel.md +++ b/docs/specification/root-channel.md @@ -26,7 +26,7 @@ RootState { } ``` -- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent MAY carry `icons` for display; when an agent's icons change, the host dispatches `root/agentsChanged` with the new icons. +- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent may carry `icons` for display. - `activeSessions` — count of non-disposed sessions. Lightweight badge counter. - `terminals` — lightweight per-terminal metadata for rendering a terminal manager UI without subscribing to every terminal. See [Terminal Channel](/specification/terminal-channel) for the full state. - `config` — host-level configuration schema and current values. diff --git a/schema/actions.schema.json b/schema/actions.schema.json index 85bc4c4e0..723b66c33 100644 --- a/schema/actions.schema.json +++ b/schema/actions.schema.json @@ -3517,12 +3517,12 @@ "items": { "$ref": "#/$defs/Icon" }, - "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + "description": "Icons for UI display, such as in an agent picker." }, "_meta": { "type": "object", "additionalProperties": {}, - "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." + "description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/commands.schema.json b/schema/commands.schema.json index 36a9958b9..5f6cb9552 100644 --- a/schema/commands.schema.json +++ b/schema/commands.schema.json @@ -2814,12 +2814,12 @@ "items": { "$ref": "#/$defs/Icon" }, - "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + "description": "Icons for UI display, such as in an agent picker." }, "_meta": { "type": "object", "additionalProperties": {}, - "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." + "description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/errors.schema.json b/schema/errors.schema.json index 93dd7821b..860c17de8 100644 --- a/schema/errors.schema.json +++ b/schema/errors.schema.json @@ -720,12 +720,12 @@ "items": { "$ref": "#/$defs/Icon" }, - "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + "description": "Icons for UI display, such as in an agent picker." }, "_meta": { "type": "object", "additionalProperties": {}, - "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." + "description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/notifications.schema.json b/schema/notifications.schema.json index a62886ae1..61a8f050b 100644 --- a/schema/notifications.schema.json +++ b/schema/notifications.schema.json @@ -1021,12 +1021,12 @@ "items": { "$ref": "#/$defs/Icon" }, - "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + "description": "Icons for UI display, such as in an agent picker." }, "_meta": { "type": "object", "additionalProperties": {}, - "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." + "description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/schema/state.schema.json b/schema/state.schema.json index fec2389b9..58fc10444 100644 --- a/schema/state.schema.json +++ b/schema/state.schema.json @@ -630,12 +630,12 @@ "items": { "$ref": "#/$defs/Icon" }, - "description": "Icons for UI display, such as in an agent picker. When an agent's icons\nchange, the host dispatches `root/agentsChanged` with the new icons." + "description": "Icons for UI display, such as in an agent picker." }, "_meta": { "type": "object", "additionalProperties": {}, - "description": "Additional implementation-defined metadata for this agent.\n\nClients MAY look for well-known keys here to provide enhanced UI." + "description": "Additional implementation-defined metadata for this agent.\nMUST NOT contain a credential.\n\nClients MAY look for well-known keys here to provide enhanced UI." } }, "required": [ diff --git a/types/channels-root/state.ts b/types/channels-root/state.ts index 33e21bfab..c7dec9496 100644 --- a/types/channels-root/state.ts +++ b/types/channels-root/state.ts @@ -105,13 +105,11 @@ export interface AgentInfo { * id. */ capabilities?: AgentCapabilities; - /** - * Icons for UI display, such as in an agent picker. When an agent's icons - * change, the host dispatches `root/agentsChanged` with the new icons. - */ + /** Icons for UI display, such as in an agent picker. */ icons?: Icon[]; /** * Additional implementation-defined metadata for this agent. + * MUST NOT contain a credential. * * Clients MAY look for well-known keys here to provide enhanced UI. */ From af419567f523248f9a2d726ce2f86d927b44d085 Mon Sep 17 00:00:00 2001 From: "Vladislav.Ertel" Date: Thu, 26 Nov 2026 23:40:47 +0000 Subject: [PATCH 3/3] docs: tighten AgentInfo.icons changelog and spec wording Make the Rust migration note verb-first like earlier Rust entries, say why AgentInfo._meta helps, link both fragments to the PR, link the Icon reference from the root channel spec, and annotate the icons line in the state model sketch. Co-Authored-By: Claude Opus 5.5 --- docs/.changes/20261126-agent-info-icons-migration.json | 5 +++-- docs/.changes/20261126-agent-info-icons.json | 3 ++- docs/guide/state-model.md | 2 +- docs/specification/root-channel.md | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/.changes/20261126-agent-info-icons-migration.json b/docs/.changes/20261126-agent-info-icons-migration.json index 24753bd9f..85ad3d50c 100644 --- a/docs/.changes/20261126-agent-info-icons-migration.json +++ b/docs/.changes/20261126-agent-info-icons-migration.json @@ -1,5 +1,6 @@ { "type": "changed", - "message": "Direct Rust struct literals for `AgentInfo` must now include `icons: None` and `meta: None`.", - "targets": ["rust"] + "message": "Require direct Rust struct literals for `AgentInfo` to initialize `icons: None` and `meta: None` (added for agent icons).", + "targets": ["rust"], + "issues": [636] } diff --git a/docs/.changes/20261126-agent-info-icons.json b/docs/.changes/20261126-agent-info-icons.json index a4f88dc69..39ddb5b4c 100644 --- a/docs/.changes/20261126-agent-info-icons.json +++ b/docs/.changes/20261126-agent-info-icons.json @@ -1,4 +1,5 @@ { "type": "added", - "message": "Add optional `AgentInfo.icons` so clients can show agent icons from root state, and an optional `AgentInfo._meta` for implementation-defined agent metadata." + "message": "Add optional `AgentInfo.icons` so clients can show agent icons from root state, and an optional `AgentInfo._meta` that `root/agentsChanged` keeps current, for implementation-defined agent metadata.", + "issues": [636] } diff --git a/docs/guide/state-model.md b/docs/guide/state-model.md index 3b16f0540..9d998a18c 100644 --- a/docs/guide/state-model.md +++ b/docs/guide/state-model.md @@ -25,7 +25,7 @@ AgentInfo { description: string models: SessionModelInfo[] customizations?: Customization[] // Open Plugins - icons?: Icon[] + icons?: Icon[] // e.g. for an agent picker _meta?: Record } diff --git a/docs/specification/root-channel.md b/docs/specification/root-channel.md index a3098c9c1..601261909 100644 --- a/docs/specification/root-channel.md +++ b/docs/specification/root-channel.md @@ -26,7 +26,7 @@ RootState { } ``` -- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent may carry `icons` for display. +- `agents` — agent backends the server can speak to, including any `protectedResources` they require for authentication. See [Authentication](/specification/authentication). Each agent can carry [`icons`](/reference/common#icon) for display. - `activeSessions` — count of non-disposed sessions. Lightweight badge counter. - `terminals` — lightweight per-terminal metadata for rendering a terminal manager UI without subscribing to every terminal. See [Terminal Channel](/specification/terminal-channel) for the full state. - `config` — host-level configuration schema and current values.