Add optional _meta slot to SystemNotificationResponsePart#308
Add optional _meta slot to SystemNotificationResponsePart#308colbylwilliams wants to merge 4 commits into
_meta slot to SystemNotificationResponsePart#308Conversation
SystemNotificationResponsePart previously conveyed a harness event as human-readable `content` only, so a client could not categorize, icon, group, filter, or localize these parts without string-matching prose. Add the standard `_meta?: Record<string, unknown>` escape hatch — consistent with the MCP `_meta` convention already used across AHP state carriers (Message, ChatState, SessionState, RootState, ToolDefinition, etc.) and with the doctrine's explicit-escape-hatch principle. Purely additive and optional: minimal clients ignore it and still render from `content`; hosts that omit it stay compliant. Regenerate the schema and all five client mirrors, document the part (previously missing) in the Response Parts section of the state model guide, and add the entry to the spec and per-client CHANGELOGs. Closes #307 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a convention-aligned, optional _meta metadata bag to SystemNotificationResponsePart so hosts can attach machine-readable trigger descriptors while preserving coherent rendering from content alone. This extends the existing _meta escape-hatch pattern to response parts and propagates the additive change through schemas, docs, generated clients, and release notes.
Changes:
- Add optional
_meta?: Record<string, unknown>toSystemNotificationResponsePartin the protocol types. - Regenerate JSON Schemas and all client mirrors to include the new optional field on the wire (
_meta) with language-idiomatic property names. - Document the response part in the state model guide and record the additive change in the spec + per-client changelogs.
Show a summary per file
| File | Description |
|---|---|
| types/channels-chat/state.ts | Adds optional _meta on SystemNotificationResponsePart with usage guidance. |
| schema/state.schema.json | Updates schema for SystemNotificationResponsePart to include optional _meta. |
| schema/notifications.schema.json | Propagates optional _meta into the notifications schema mirror. |
| schema/errors.schema.json | Propagates optional _meta into the errors schema mirror. |
| schema/commands.schema.json | Propagates optional _meta into the commands schema mirror. |
| schema/actions.schema.json | Propagates optional _meta into the actions schema mirror. |
| docs/guide/state-model.md | Documents SystemNotificationResponsePart (including _meta) in the Response Parts section. |
| CHANGELOG.md | Adds spec changelog bullet for the new optional _meta slot. |
| clients/typescript/CHANGELOG.md | Notes the additive TypeScript surface change (_meta?: Record<string, unknown>). |
| clients/swift/CHANGELOG.md | Notes the additive Swift surface change (meta serialized as _meta). |
| clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift | Regenerated Swift types to include meta ↔ _meta coding key and initializer default. |
| clients/rust/crates/ahp-types/src/state.rs | Regenerated Rust types to include optional meta field serialized as _meta. |
| clients/rust/CHANGELOG.md | Notes the additive Rust surface change (meta / _meta). |
| clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt | Regenerated Kotlin types to include optional meta with @SerialName("_meta"). |
| clients/kotlin/CHANGELOG.md | Notes the additive Kotlin surface change (meta serialized as _meta). |
| clients/go/ahptypes/state.generated.go | Regenerated Go types to include optional Meta (json:"_meta,omitempty"). |
| clients/go/CHANGELOG.md | Notes the additive Go surface change (Meta / _meta). |
Review details
- Files reviewed: 15/17 changed files
- Comments generated: 0
- Review effort level: Low
roblourens
left a comment
There was a problem hiding this comment.
This is fine, but is there some origin that would make sense as a real property?
Yea, there is still not, at least not in a standard way. Do we want to actually be more descriptive here? |
…tion-meta-slot # Conflicts: # CHANGELOG.md # clients/go/CHANGELOG.md # clients/kotlin/CHANGELOG.md # clients/rust/CHANGELOG.md # clients/swift/CHANGELOG.md # clients/typescript/CHANGELOG.md
|
Agreed. I started with |
…tion-meta-slot # Conflicts: # docs/guide/state-model.md
|
Let's start here but plan to formalize more data in the future |
…tion-meta-slot # Conflicts: # clients/go/CHANGELOG.md # clients/kotlin/CHANGELOG.md # clients/rust/CHANGELOG.md # clients/swift/CHANGELOG.md # clients/typescript/CHANGELOG.md
Summary
Closes #307.
SystemNotificationResponsePartconveys a harness event as human-readablecontentonly. There is no machine-readable indication of what triggered it, so a client cannot categorize, icon, group, filter, or localize these parts without string-matching natural-language prose. This adds the standard_metaescape hatch to close that gap.Why
_meta?: Record<string, unknown>is the established escape hatch across AHP state carriers (Message,ChatState,UsageInfo,ErrorInfo,RootState,ToolDefinition, session types, …), mirroring the MCP_metaconvention. No response-part type carried one before — and the system notification, whose whole purpose is to surface an out-of-band harness event, is the part that most needs it._metaand still renders coherently fromcontent; a typed trigger discriminator can graduate out of_metalater if a portable subset proves worthwhile.Compatibility
Purely additive and optional. Existing clients ignore
_meta; hosts that omit it stay compliant. No reducer change is required —SystemNotificationResponsePartis delivered via the existingChatResponsePartAction, whose reducer appends the part wholesale, so_metarides through unchanged.Changes
types/channels-chat/state.ts— add the_metaslot with a convention-matching doc comment.docs/guide/state-model.md— documentSystemNotificationResponsePartin the Response Parts section (it was previously missing) and describe the_metaslot.### Addedentry under## [0.5.2] — Unreleasedin the spec changelog and every per-client changelog.