Skip to content

Add optional _meta property bag to RootState#199

Merged
roblourens merged 4 commits into
mainfrom
roblou/root-state-meta
Jun 6, 2026
Merged

Add optional _meta property bag to RootState#199
roblourens merged 4 commits into
mainfrom
roblou/root-state-meta

Conversation

@roblourens
Copy link
Copy Markdown
Member

What

Adds 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 itself (as opposed to per-session metadata). The first intended consumer is a well-known hostBuild key 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.it

Why on RootState

RootState is 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 the hostBuild key is a convention layered on top of the open _meta bag, exactly like the existing git key on SessionState._meta.generic

Changes

  • types/channels-root/state.ts: add _meta to RootState.
  • Regenerated all client artifacts (Go, Kotlin, Rust, Swift, TypeScript) and JSON schemas via npm run generate.
  • CHANGELOG entries added to the spec (## [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)

roblourens and others added 3 commits June 5, 2026 20:09
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>
@roblourens roblourens marked this pull request as ready for review June 6, 2026 16:16
@roblourens roblourens enabled auto-merge (squash) June 6, 2026 16:16
@roblourens roblourens merged commit 334240c into main Jun 6, 2026
8 checks passed
@roblourens roblourens deleted the roblou/root-state-meta branch June 6, 2026 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants