Skip to content

Hoist _meta onto CustomizationBase so every customization type carries provider metadata uniformly#318

Merged
connor4312 merged 2 commits into
mainfrom
colby-hoist-meta-customization-base
Jul 8, 2026
Merged

Hoist _meta onto CustomizationBase so every customization type carries provider metadata uniformly#318
connor4312 merged 2 commits into
mainfrom
colby-hoist-meta-customization-base

Conversation

@colbylwilliams

@colbylwilliams colbylwilliams commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

_meta previously 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 _meta slot from AgentCustomization up to the shared CustomizationBase, so every customization type carries one uniformly, and drops the now-redundant per-type declaration on AgentCustomization.

Fixes #316.

Independent validation

I verified the issue's premises against the current tree rather than taking them on faith:

  • Current state matches the issue. CustomizationBase (types/channels-session/state.ts) had id/uri/name/icons?/range? and no _meta; AgentCustomization was the only type with a _meta slot. Confirmed via git history that _meta was added to AgentCustomization as a deliberate one-off (e3afb2d), not as a considered "agents only" design decision.
  • Aligns with doctrine. docs/guide/doctrine.md explicitly 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. _meta is 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.
  • Wire-compatible. The key, shape, and semantics of _meta are unchanged; AgentCustomization still 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? to CustomizationBase, remove it from AgentCustomization.
  • Regenerated JSON schemas + all client mirrors (Rust / Kotlin / Swift / TypeScript / Go). Verified in state.schema.json that all eight concrete customization types gained _meta (false → true) while AgentCustomization retained it, and that AgentCustomization still carries the field in every generated client.
  • docs/guide/customizations.md: new "Provider metadata" note describing _meta as the uniform, opaque escape hatch (prefer a first-class field where data has a natural home).
  • CHANGELOG entries in the root and all five client changelogs.

Verification

  • npm run generate + npm test — all tests pass (typecheck, lint, release-metadata, changelog, reducer coverage, schema self-consistency).
  • Go go build ./... + gofmt -l clean.
  • Rust cargo fmt --check + cargo clippy clean.
  • Swift swift build clean.
  • Kotlin verified by inspection (generated code matches the established, already-compiling @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 version on PluginCustomization, closing #315) adds a typed field where the concept has a natural home. main has been merged into this branch, so both changes coexist: PluginCustomization carries both version and _meta, and every other customization type gains _meta.

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>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> to CustomizationBase and removed the now-redundant AgentCustomization._meta declaration (inherited now).
  • Regenerated schema/*.schema.json artifacts 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
connor4312 previously approved these changes Jul 8, 2026
@connor4312 connor4312 enabled auto-merge July 8, 2026 16:58
anthonykim1
anthonykim1 previously approved these changes Jul 8, 2026
vritant24
vritant24 previously approved these changes Jul 8, 2026
@connor4312 connor4312 merged commit 2cfdc73 into main Jul 8, 2026
9 checks passed
@connor4312 connor4312 deleted the colby-hoist-meta-customization-base branch July 8, 2026 22:52
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.

Hoist _meta onto CustomizationBase so every customization type carries provider metadata uniformly

5 participants