Skip to content

Commit 4113fe0

Browse files
authored
docs(protocol): define invalid base64, late output and retention for v2 terminals (#2548)
Display-only terminals didn't say what to do with data that isn't valid base64, output after a concrete exitStatus, or how much output to keep. Clients ignore invalid chunks or snapshots and keep the bytes they have, still append output that arrives after exit (Agents should send it before), and may bound retained output, with a later snapshot replacing it.
1 parent 6681184 commit 4113fe0

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎docs/protocol/v2/draft/tool-calls.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,12 @@ sequences, so decoders retain parser state across chunks. Optional nullable
501501
`_meta` is chunk-scoped; omission and `null` both mean no chunk metadata was
502502
provided.
503503

504+
Clients **SHOULD** ignore a chunk or snapshot whose `data` isn't valid base64,
505+
keeping the bytes they already have. Agents **SHOULD** send all output before a
506+
concrete `exitStatus`, but Clients still append output that arrives after it.
507+
Clients **MAY** bound how much output they keep, for example by dropping the
508+
oldest bytes; a later `output` snapshot replaces whatever they kept.
509+
504510
Terminal output is Agent content. Clients **SHOULD** render it so that it cannot write the clipboard, send input or query responses, or open links without user action, and sanitizers **SHOULD** keep state across chunks.
505511

506512
### Diffs

‎docs/protocol/v2/tool-calls.mdx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,12 @@ sequences, so decoders retain parser state across chunks. Optional nullable
501501
`_meta` is chunk-scoped; omission and `null` both mean no chunk metadata was
502502
provided.
503503

504+
Clients **SHOULD** ignore a chunk or snapshot whose `data` isn't valid base64,
505+
keeping the bytes they already have. Agents **SHOULD** send all output before a
506+
concrete `exitStatus`, but Clients still append output that arrives after it.
507+
Clients **MAY** bound how much output they keep, for example by dropping the
508+
oldest bytes; a later `output` snapshot replaces whatever they kept.
509+
504510
Terminal output is Agent content. Clients **SHOULD** render it so that it cannot write the clipboard, send input or query responses, or open links without user action, and sanitizers **SHOULD** keep state across chunks.
505511

506512
### Diffs

0 commit comments

Comments
 (0)