Expose content hashes on prepared runs

This commit is contained in:
2026-11-20 04:16:50 +00:00
parent e415ad43ce
commit dd40171c01
8 changed files with 41 additions and 2 deletions

View File

@@ -226,6 +226,13 @@ type PreparedRun struct {
SessionID string `json:"session_id,omitempty"`
// RenderedPromptHash is an opaque equality value for SessionID and Messages.
RenderedPromptHash string `json:"rendered_prompt_hash"`
// MessageContentHash is an opaque, filename-safe equality value computed
// during preparation from the ordered roles and exact text of Messages.
// It excludes session identity, cache hints, and other metadata outside the
// messages. Identical role/text sequences retain the same value across
// releases while the hash scheme is unchanged. A scheme change is a
// compatibility change and will be documented; no scheme is permanent.
MessageContentHash string `json:"message_content_hash"`
// Messages are the complete effective messages that Run or RunPrepared passes
// to the LLM client: captured history, if any, followed by definition
// messages and RunRequest.AppendedMessages in caller order.