diff --git a/clients/go/ahptypes/state.generated.go b/clients/go/ahptypes/state.generated.go index c7b72ec1..d0ccedd8 100644 --- a/clients/go/ahptypes/state.generated.go +++ b/clients/go/ahptypes/state.generated.go @@ -2267,6 +2267,10 @@ type ErrorInfo struct { Message string `json:"message"` // Stack trace Stack *string `json:"stack,omitempty"` + // Additional provider-specific metadata for this error. + // Clients MAY look for well-known optional keys here to provide enhanced UI + // (e.g. a structured chat fetch error for richer, localized messaging). + Meta map[string]json.RawMessage `json:"_meta,omitempty"` } // A point-in-time snapshot of a subscribed resource's state, returned by 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 ebc4e7bc..416f6942 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 @@ -3193,7 +3193,14 @@ data class ErrorInfo( /** * Stack trace */ - val stack: String? = null + val stack: String? = null, + /** + * Additional provider-specific metadata for this error. + * Clients MAY look for well-known optional keys here to provide enhanced UI + * (e.g. a structured chat fetch error for richer, localized messaging). + */ + @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 5395b684..4e669ae5 100644 --- a/clients/rust/crates/ahp-types/src/state.rs +++ b/clients/rust/crates/ahp-types/src/state.rs @@ -2804,6 +2804,11 @@ pub struct ErrorInfo { /// Stack trace #[serde(default, skip_serializing_if = "Option::is_none")] pub stack: Option, + /// Additional provider-specific metadata for this error. + /// Clients MAY look for well-known optional keys here to provide enhanced UI + /// (e.g. a structured chat fetch error for richer, localized messaging). + #[serde(rename = "_meta", default, skip_serializing_if = "Option::is_none")] + pub meta: Option, } /// A point-in-time snapshot of a subscribed resource's state, returned by diff --git a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift index f2841874..17dcbdd6 100644 --- a/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift +++ b/clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift @@ -3486,15 +3486,28 @@ public struct ErrorInfo: Codable, Sendable { public var message: String /// Stack trace public var stack: String? + /// Additional provider-specific metadata for this error. + /// Clients MAY look for well-known optional keys here to provide enhanced UI + /// (e.g. a structured chat fetch error for richer, localized messaging). + public var meta: [String: AnyCodable]? + + enum CodingKeys: String, CodingKey { + case errorType + case message + case stack + case meta = "_meta" + } public init( errorType: String, message: String, - stack: String? = nil + stack: String? = nil, + meta: [String: AnyCodable]? = nil ) { self.errorType = errorType self.message = message self.stack = stack + self.meta = meta } } diff --git a/schema/actions.schema.json b/schema/actions.schema.json index b306559a..09b93f24 100644 --- a/schema/actions.schema.json +++ b/schema/actions.schema.json @@ -2025,6 +2025,11 @@ "stack": { "type": "string", "description": "Stack trace" + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional provider-specific metadata for this error.\nClients MAY look for well-known optional keys here to provide enhanced UI\n(e.g. a structured chat fetch error for richer, localized messaging)." } }, "required": [ diff --git a/schema/commands.schema.json b/schema/commands.schema.json index 6d7a4bdd..691c6cfd 100644 --- a/schema/commands.schema.json +++ b/schema/commands.schema.json @@ -1554,6 +1554,11 @@ "stack": { "type": "string", "description": "Stack trace" + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional provider-specific metadata for this error.\nClients MAY look for well-known optional keys here to provide enhanced UI\n(e.g. a structured chat fetch error for richer, localized messaging)." } }, "required": [ diff --git a/schema/errors.schema.json b/schema/errors.schema.json index e3e5ab92..b9a750bc 100644 --- a/schema/errors.schema.json +++ b/schema/errors.schema.json @@ -471,6 +471,11 @@ "stack": { "type": "string", "description": "Stack trace" + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional provider-specific metadata for this error.\nClients MAY look for well-known optional keys here to provide enhanced UI\n(e.g. a structured chat fetch error for richer, localized messaging)." } }, "required": [ diff --git a/schema/notifications.schema.json b/schema/notifications.schema.json index f6c2cc4a..288e2359 100644 --- a/schema/notifications.schema.json +++ b/schema/notifications.schema.json @@ -600,6 +600,11 @@ "stack": { "type": "string", "description": "Stack trace" + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional provider-specific metadata for this error.\nClients MAY look for well-known optional keys here to provide enhanced UI\n(e.g. a structured chat fetch error for richer, localized messaging)." } }, "required": [ diff --git a/schema/state.schema.json b/schema/state.schema.json index c18dd94a..72adb902 100644 --- a/schema/state.schema.json +++ b/schema/state.schema.json @@ -382,6 +382,11 @@ "stack": { "type": "string", "description": "Stack trace" + }, + "_meta": { + "type": "object", + "additionalProperties": {}, + "description": "Additional provider-specific metadata for this error.\nClients MAY look for well-known optional keys here to provide enhanced UI\n(e.g. a structured chat fetch error for richer, localized messaging)." } }, "required": [ diff --git a/types/common/state.ts b/types/common/state.ts index fd22f7f9..4c01ffd4 100644 --- a/types/common/state.ts +++ b/types/common/state.ts @@ -313,6 +313,12 @@ export interface ErrorInfo { message: string; /** Stack trace */ stack?: string; + /** + * Additional provider-specific metadata for this error. + * Clients MAY look for well-known optional keys here to provide enhanced UI + * (e.g. a structured chat fetch error for richer, localized messaging). + */ + _meta?: Record; } /**