docs(unstable-v2): list all SessionUpdate variants on the prompt lifecycle page - #1891
Open
tarikermis wants to merge 1 commit into
Open
Conversation
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.
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/updatevariants, but the schema'sSessionUpdateunion defines more:schema/v2/schema.json: 16 named variants + anothercatch-allschema/v2/schema.unstable.json: 17 named variants (addsplan_removed) + anothercatch-allVariants such as
available_commands_update,config_option_update,session_info_update, andterminal_updatenever 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 tabledocs/protocol/v2/draft/prompt-lifecycle.mdx(draft/unstable): 17-row table, withplan_removedmarked as draft-unstable;state_updatealso lists the unstableusagefield onidleEach page gets:
<Note>at the start of "Agent Reports Output" clarifying the walkthrough covers the common prompt-turn variants only.tool-calls,agent-plan,slash-commands,session-config-options,session-list) where each is documented in depth._-prefixed custom variants and the preserve-and-ignore rule for unrecognized variants, pointing at the existing Enum and Tagged-Union Variants section and theSessionUpdateschema reference — so no extensibility.mdx changes were needed (unlike v1 in docs: clarify the session/update variant set is not exhaustive #1858).Verification
schema/v2/schema.jsonandschema/v2/schema.unstable.json; a script asserts each table matches its schema exactly (16/16 and 17/17, no extras).$defsproperties/required lists (e.g.tool_call_update: requiredtoolCallId+ patch fields;usage_update: requiredused,size, optionalcost; unstableIdleStateUpdateadds optionalusage).npx prettier --checkpasses 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/v2and the generated schema JSONs. Its findings (note placement splitting an example intro,Agentcasing,plan_removedlink text, missing unstableusagefield, an over-long sentence) are all addressed in this revision.Limitations
Docs-only change; I did not run
mint devto visually render the pages. The table/<Note>syntax mirrors existing usage on these pages and in #1858, and all anchors were verified statically.