ModelConnector/schemas/transport_receipt.json
Meta Vens b115e870f0 connector-reasoning-item (B3b): provider reasoning state is one opaque transcript item; the service refuses it foreign in flight and drops it elsewhere
InputItem::ReasoningState and TransportEventPayload::ReasoningState carry the
connector's own bytes as MessagePack bin. TransportService owns the provider
tag: partition_reasoning is the one place foreignness is decided, begin refuses
foreign state in the in-flight exchange (ForeignReasoningState), drops and
counts it earlier (receipt.foreign_reasoning_dropped), and complete gates the
receipt's provider and count. A backend now receives a ProviderCall holding
only the filtered request and builds its result through call.transported, so it
can neither see foreign state nor write receipt identity.
TransportResult::transcript_items hands a completed result back as items the
caller replays verbatim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 12:50:55 +01:00

193 lines
4.6 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "TransportReceipt",
"type": "object",
"properties": {
"caller_runtime_id": {
"type": "string"
},
"foreign_reasoning_dropped": {
"description": "How many foreign `ReasoningState` items the service removed from the\nrequest before the backend saw it.",
"type": "integer",
"format": "uint32",
"minimum": 0
},
"model": {
"type": "string"
},
"native_request_sha256": {
"type": "array",
"items": {
"type": "integer",
"format": "uint8",
"maximum": 255,
"minimum": 0
},
"maxItems": 32,
"minItems": 32
},
"outcome": {
"$ref": "#/$defs/TransportOutcome"
},
"provider": {
"type": "string"
},
"provider_request_sha256": {
"type": "array",
"items": {
"type": "integer",
"format": "uint8",
"maximum": 255,
"minimum": 0
},
"maxItems": 32,
"minItems": 32
},
"request_id": {
"type": "string"
},
"schema_id": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"schema_id",
"request_id",
"caller_runtime_id",
"native_request_sha256",
"provider_request_sha256",
"model",
"provider",
"foreign_reasoning_dropped",
"outcome"
],
"$defs": {
"FailureKind": {
"description": "What kind of failure a provider reported. `ResultSize` is the connector's own\nstand-in for a result whose sealed frame cannot be carried.",
"type": "string",
"enum": [
"result_size",
"invalid_request",
"authentication",
"rate_limited",
"unavailable",
"timeout",
"provider"
]
},
"StopReason": {
"description": "Why a provider stopped producing output.",
"type": "string",
"enum": [
"end_turn",
"tool_use",
"max_output_tokens",
"stop_sequence",
"refusal",
"context_window"
]
},
"TransportOutcome": {
"oneOf": [
{
"type": "object",
"properties": {
"Completed": {
"type": "object",
"properties": {
"provider_response_id": {
"type": [
"string",
"null"
]
},
"stop_reason": {
"$ref": "#/$defs/StopReason"
},
"usage": {
"$ref": "#/$defs/Usage"
}
},
"additionalProperties": false,
"required": [
"stop_reason",
"usage"
]
}
},
"additionalProperties": false,
"required": [
"Completed"
]
},
{
"type": "object",
"properties": {
"Failed": {
"type": "object",
"properties": {
"kind": {
"$ref": "#/$defs/FailureKind"
},
"message": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"kind",
"message"
]
}
},
"additionalProperties": false,
"required": [
"Failed"
]
}
]
},
"Usage": {
"description": "Token accounting for one completed request. Cache reads and writes are\ncounted apart from plain input; `reasoning_tokens` is absent when the\nprovider does not report it.",
"type": "object",
"properties": {
"cache_read_tokens": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"cache_write_tokens": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"input_tokens": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"output_tokens": {
"type": "integer",
"format": "uint64",
"minimum": 0
},
"reasoning_tokens": {
"type": [
"integer",
"null"
],
"format": "uint64",
"minimum": 0
}
},
"additionalProperties": false,
"required": [
"input_tokens",
"cache_read_tokens",
"cache_write_tokens",
"output_tokens"
]
}
}
}