Add optional _meta property bag to RootState#199
Merged
Conversation
Add an open `_meta: Record<string, unknown>` property to `RootState`, mirroring the existing MCP-style `_meta` convention already used on `SessionState`, messages, tool calls, and `SessionModelInfo`. This gives agent hosts a place to attach implementation-defined metadata about the host for example a well-known `hostBuild` key carrying theitself hosting program's build version/commit/date. Regenerated all client artifacts (Go, Kotlin, Rust, Swift, TypeScript) and JSON schemas, and added CHANGELOG entries to the spec and every client. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The hand-written `ahp` crate constructs `RootState` literally in several places (host runtime, multi-host state mirror, reducer tests/examples, and doctests) that the code generator does not touch. Add `meta: None` to each so the workspace compiles against the regenerated `ahp-types::RootState`. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Drop the `hostBuild` example and MCP-convention note from the `RootState._meta` doc comment, leaving the generic "Clients MAY look for well-known keys here to provide enhanced UI." Regenerated all client artifacts and schemas. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
lszomoru
approved these changes
Jun 6, 2026
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.
What
Adds an open
_meta?: Record<string, unknown>property toRootState, mirroring the existing MCP-style_metaconvention already used onSessionState, messages, tool calls, andSessionModelInfo.This gives agent hosts a place to attach implementation-defined metadata about the host itself (as opposed to per-session metadata). The first intended consumer is a well-known
hostBuildkey carrying the hosting program's build information (version, commit, date), so a client can see which build is hosting useful when inspecting the output of a remote agent host.itWhy on
RootStateRootStateis the agent host's own global state, delivered as a snapshot at connect time, so any client reliably receives the metadata as part of the handshake. The protocol itself stays thehostBuildkey is a convention layered on top of the open_metabag, exactly like the existinggitkey onSessionState._meta.genericChanges
types/channels-root/state.ts: add_metatoRootState.npm run generate.## [0.4.0]) and every client's## [Unreleased].Validation
npm test(typecheck + lint +verify:release-metadata+verify:changelog+ reducer tests, 235 passing).(Written by Copilot)