Add TM8b summaryVersion on MessageAnnotations#482
Draft
AndyTWF wants to merge 1 commit into
Draft
Conversation
Successive annotation summaries on the same referenced message need an identifier that is independent of the referenced message's `serial`, `timestamp`, and `version` (which all refer to the message being annotated, not to the summary). Without this, consumers cannot order two summaries of the same message, or tell when a summary itself was produced. Introduces `MessageAnnotations.summaryVersion` (TM8b) and a new `SummaryVersion` class with `serial` (TM8b1) and `timestamp` (TM8b2). TM8b3 spells out that the SDK populates it from the wire when present (including when `summary` is empty, since the version advances on every summary publish) and must not synthesise a default when absent. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds
summaryVersiontoMessageAnnotationsso SDKs surface an identifier for the summary itself, distinct from the referenced message'sserial/timestamp/version.Motivation
The existing fields on
Messageall refer to the message being annotated, not to the summary delivered alongside it. That leaves consumers with no way to:This is especially important because the summary version advances on every summary publish — including ones that produce an empty
summary— so the version is the only reliable ordering signal for summary updates.Changes
features.md:TM8b,TM8b1,TM8b2,TM8b3underMessageAnnotations.summaryVersion: SummaryVersion?onMessageAnnotationsand a newSummaryVersionclass.api-docstrings.md:summaryVersionrow added toMessageAnnotations.class SummaryVersionsection withserialandtimestamp.TM8b3is explicit that the SDK MUST populatesummaryVersionfrom the wire when present (regardless of whethersummaryis empty) and MUST NOT synthesise a default when absent — leaving it unset (e.g.null) instead. This avoids SDKs inventing version identifiers that could collide or mislead consumers.Test plan
(cd build && npm run lint)) — confirmed locally.TM8b*IDs do not collide with any in-flight PRs.🤖 Generated with Claude Code