Skip to content

docs(unstable-v2): list all SessionUpdate variants on the prompt lifecycle page - #1891

Open
tarikermis wants to merge 1 commit into
agentclientprotocol:mainfrom
tarikermis:docs/v2-prompt-lifecycle-update-variants
Open

docs(unstable-v2): list all SessionUpdate variants on the prompt lifecycle page#1891
tarikermis wants to merge 1 commit into
agentclientprotocol:mainfrom
tarikermis:docs/v2-prompt-lifecycle-update-variants

Conversation

@tarikermis

Copy link
Copy Markdown

Refs #1694. Complements #1858, which fixes the v1 prompt-turn page and explicitly left the v2 gap for a follow-up.

What & why

The v2 prompt-lifecycle pages walk a prompt turn through JSON examples for 9 session/update variants, but the schema's SessionUpdate union defines more:

  • schema/v2/schema.json: 16 named variants + an other catch-all
  • schema/v2/schema.unstable.json: 17 named variants (adds plan_removed) + an other catch-all

Variants such as available_commands_update, config_option_update, session_info_update, and terminal_update never appear on the page, and nothing marks the walkthrough as a subset — the same trap a client author reported in #1694 for v1 (spec-conformant traffic looking off-spec).

This PR updates both v2 copies, each matched to its own schema version:

  • docs/protocol/v2/prompt-lifecycle.mdx (stable v2): 16-row table
  • docs/protocol/v2/draft/prompt-lifecycle.mdx (draft/unstable): 17-row table, with plan_removed marked as draft-unstable; state_update also lists the unstable usage field on idle

Each page gets:

  1. A <Note> at the start of "Agent Reports Output" clarifying the walkthrough covers the common prompt-turn variants only.
  2. A new "Session Update Variants" section listing every schema-defined variant with what it reports, its key fields, and links to the topical pages (tool-calls, agent-plan, slash-commands, session-config-options, session-list) where each is documented in depth.
  3. A short paragraph covering _-prefixed custom variants and the preserve-and-ignore rule for unrecognized variants, pointing at the existing Enum and Tagged-Union Variants section and the SessionUpdate schema reference — so no extensibility.mdx changes were needed (unlike v1 in docs: clarify the session/update variant set is not exhaustive #1858).

Verification

  • Variant sets extracted programmatically from schema/v2/schema.json and schema/v2/schema.unstable.json; a script asserts each table matches its schema exactly (16/16 and 17/17, no extras).
  • Key-fields column cross-checked against each variant's $defs properties/required lists (e.g. tool_call_update: required toolCallId + patch fields; usage_update: required used, size, optional cost; unstable IdleStateUpdate adds optional usage).
  • Every intra-doc link anchor confirmed against the target headings in both the stable and draft trees.
  • npx prettier --check passes on both files (repo CI format gate); npm run spellcheck (typos) passes repo-wide.

Review

The full diff was reviewed by kiro-cli (claude-opus-5), which independently verified the variant lists and field claims against agent-client-protocol-schema/src/v2 and the generated schema JSONs. Its findings (note placement splitting an example intro, Agent casing, plan_removed link text, missing unstable usage field, an over-long sentence) are all addressed in this revision.

Limitations

Docs-only change; I did not run mint dev to visually render the pages. The table/<Note> syntax mirrors existing usage on these pages and in #1858, and all anchors were verified statically.

@tarikermis
tarikermis requested a review from a team as a code owner August 9, 2026 07:49
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.

1 participant