Hoist _meta onto CustomizationBase so every customization type carries provider metadata uniformly#318
Merged
Merged
Conversation
Move the optional `_meta` provider-metadata slot from `AgentCustomization` up to the shared `CustomizationBase`, so every customization type (`PluginCustomization`, `ClientPluginCustomization`, `DirectoryCustomization`, `SkillCustomization`, `PromptCustomization`, `RuleCustomization`, `HookCustomization`, and `McpServerCustomization`) carries the same provider-specific escape hatch instead of only agents. The change is purely additive and wire-compatible: the key, shape, and semantics of `_meta` are unchanged, and `AgentCustomization` still exposes `_meta` (now by inheritance). Every other customization type simply gains the optional slot. Regenerate the JSON schemas and all client mirrors (Rust/Kotlin/Swift/ TypeScript/Go), update the customizations guide with a "Provider metadata" note, and add CHANGELOG entries. Regenerating the schemas also resolves a pre-existing dangling `$ref` to `ActionType.ChangesetFilesReviewedChanged` that was left in the committed schema by an earlier merge (the `generate-json-schema` self-consistency test was already red on main). Fixes #316 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the AHP session customization model to support a uniform provider-specific metadata escape hatch across all customization variants by hoisting the optional _meta field from AgentCustomization to the shared CustomizationBase. It then propagates the change through regenerated JSON Schemas and all client mirrors, and documents the new field’s intended usage.
Changes:
- Added optional
_meta?: Record<string, unknown>toCustomizationBaseand removed the now-redundantAgentCustomization._metadeclaration (inherited now). - Regenerated
schema/*.schema.jsonartifacts and all language client mirrors so every customization type exposes the field (wire name_meta). - Updated documentation and changelogs to describe the uniform provider metadata mechanism.
Show a summary per file
| File | Description |
|---|---|
types/channels-session/state.ts |
Hoists _meta onto CustomizationBase and removes the per-AgentCustomization definition. |
schema/state.schema.json |
Regenerated schema reflecting _meta on customization types; includes generator output fixes. |
schema/notifications.schema.json |
Regenerated schema reflecting _meta on customization shapes in notification payloads. |
schema/errors.schema.json |
Regenerated schema reflecting _meta on customization shapes in error payloads; includes generator output fixes. |
schema/commands.schema.json |
Regenerated schema reflecting _meta and fixes prior dangling $ref output. |
schema/actions.schema.json |
Regenerated schema reflecting _meta and fixes prior dangling $ref output. |
docs/guide/customizations.md |
Adds guidance for _meta as an opaque, provider-specific escape hatch. |
CHANGELOG.md |
Adds spec changelog entry for _meta being available on all customization types. |
clients/typescript/CHANGELOG.md |
Notes the new _meta field availability across customization types in the TS client. |
clients/swift/CHANGELOG.md |
Notes the new meta (wire _meta) field availability across customization types in the Swift client. |
clients/swift/AgentHostProtocol/Sources/AgentHostProtocol/Generated/State.generated.swift |
Regenerated Swift types to include meta (wire _meta) on customization structs. |
clients/rust/crates/ahp-types/src/state.rs |
Regenerated Rust types to include meta (wire _meta) on customization structs. |
clients/rust/CHANGELOG.md |
Notes the new meta (wire _meta) field availability across customization types in the Rust client. |
clients/kotlin/src/main/kotlin/com/microsoft/agenthostprotocol/generated/State.generated.kt |
Regenerated Kotlin types to include meta (wire _meta) on customization data classes. |
clients/kotlin/CHANGELOG.md |
Notes the new meta (wire _meta) field availability across customization types in the Kotlin client. |
clients/go/CHANGELOG.md |
Notes the new Meta (wire _meta) field availability across customization types in the Go client. |
clients/go/ahptypes/state.generated.go |
Regenerated Go types to include Meta (wire _meta) on customization structs. |
Review details
- Files reviewed: 15/17 changed files
- Comments generated: 0
- Review effort level: Low
connor4312
previously approved these changes
Jul 8, 2026
anthonykim1
previously approved these changes
Jul 8, 2026
vritant24
previously approved these changes
Jul 8, 2026
…omization-base # Conflicts: # CHANGELOG.md
3f67e4d
connor4312
approved these changes
Jul 8, 2026
anthonykim1
approved these changes
Jul 8, 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.
Summary
_metapreviously existed on exactly one customization type —AgentCustomization— leaving every other customization (plugin, directory, skill, prompt, rule, hook, MCP server) with no provider-specific escape hatch. This hoists the optional_metaslot fromAgentCustomizationup to the sharedCustomizationBase, so every customization type carries one uniformly, and drops the now-redundant per-type declaration onAgentCustomization.Fixes #316.
Independent validation
I verified the issue's premises against the current tree rather than taking them on faith:
CustomizationBase(types/channels-session/state.ts) hadid/uri/name/icons?/range?and no_meta;AgentCustomizationwas the only type with a_metaslot. Confirmed via git history that_metawas added toAgentCustomizationas a deliberate one-off (e3afb2d), not as a considered "agents only" design decision.docs/guide/doctrine.mdexplicitly endorses provider-specific metadata as an escape hatch ("AHP keeps escape hatches explicit") and lists "Is provider-specific metadata an enhancement rather than a requirement?" as a passing design test._metais optional and opaque, so a minimal client can ignore it and still render a coherent session — it does not smuggle agent implementation details across the host boundary. No contradiction with foundational principles._metaare unchanged;AgentCustomizationstill exposes_meta(now by inheritance), verified in all four statically-typed client mirrors. Every other type simply gains the optional slot.Changes
types/channels-session/state.ts: add_meta?toCustomizationBase, remove it fromAgentCustomization.state.schema.jsonthat all eight concrete customization types gained_meta(false → true) whileAgentCustomizationretained it, and thatAgentCustomizationstill carries the field in every generated client.docs/guide/customizations.md: new "Provider metadata" note describing_metaas the uniform, opaque escape hatch (prefer a first-class field where data has a natural home).Verification
npm run generate+npm test— all tests pass (typecheck, lint, release-metadata, changelog, reducer coverage, schema self-consistency).go build ./...+gofmt -lclean.cargo fmt --check+cargo clippyclean.swift buildclean.@SerialName("_meta")pattern; no local JDK/podman to build).Relationship to #315 / #317
Complementary. This is the generic fallback for provider-specific data with no first-class home; #317 (native
versiononPluginCustomization, closing #315) adds a typed field where the concept has a natural home.mainhas been merged into this branch, so both changes coexist:PluginCustomizationcarries bothversionand_meta, and every other customization type gains_meta.