Add optional _meta slot to SystemNotificationResponsePart#308
Open
colbylwilliams wants to merge 1 commit into
Open
Add optional _meta slot to SystemNotificationResponsePart#308colbylwilliams wants to merge 1 commit into
_meta slot to SystemNotificationResponsePart#308colbylwilliams wants to merge 1 commit into
Conversation
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
approved these changes
Jul 7, 2026
roblourens
left a comment
Member
There was a problem hiding this comment.
This is fine, but is there some origin that would make sense as a real property?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.