Add optional _meta slot to SystemNotificationResponsePart#308
Conversation
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? |
|
Agreed. I started with |
|
Let's start here but plan to formalize more data in the future |
Add an optional `_meta` bag to `SystemNotificationResponsePart`, following the MCP `_meta` convention. A host MAY attach a machine-readable descriptor of what triggered the notification so clients can categorize, icon, group, filter, or localize it without parsing `content`; clients render coherently from `content` alone when `_meta` is absent or unrecognized. Regenerate schema and all client mirrors, and document the slot in the state-model guide. Changelog is tracked via a docs/.changes fragment per the fragment workflow; no CHANGELOG.md edits. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e5ccc6b to
5dbf15c
Compare
Main released AHP 0.5.2 (#329) and bumped PROTOCOL_VERSION to 0.6.0 for ongoing development, and switched the repo to a JSON changelog-fragment workflow (#331): normal PRs now add a fragment under `docs/.changes/` instead of editing the six shared CHANGELOGs. Also brings in the optional `_meta` slot on `SystemNotificationResponsePart` (#308), the resolved input-request turn-transcript record (#324), resource convenience methods, and assorted docs. Adopted the new conventions for the canvas feature: - Dropped the manual canvas bullets from the six CHANGELOGs (took main's released `## [0.5.2]` + empty `## [0.6.0] — Unreleased`) and replaced them with a single `docs/.changes/20260709-canvas-channel.json` fragment. - Moved the five canvas action registrations from the now-released 0.5.2 to 0.6.0 in `types/version/registry.ts`, since the canvas channel was not part of the 0.5.2 release. Resolved `clients/rust/crates/ahp/src/reducers.rs` by unioning the state imports so it keeps both `CanvasState` and main's new `InputRequestResponsePart` (cargo fmt re-wrapped). Regenerated all client artifacts and schemas. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.