Pi protects the conversation from oversized tool output by writing the complete result to a file and returning a bounded view. Rho needs the same observable behavior expressed through its artifact and async protocols.
Contract
- An explicit policy value decides when a tool result is materialized; an S7 generic allows the host or an extension to replace that policy.
- Persist the complete result asynchronously before adding its reference to the session.
- Put a typed artifact reference in the transcript with media type, byte count, content digest, provenance, and the reason materialization was selected.
- Include a bounded typed preview (for example head and tail segments), clearly recording omitted bytes or lines. Never silently truncate.
- Treat a filesystem path as one storage implementation, not as the durable identity. Local files, a content-addressed store, a targets-backed implementation, or a remote store can implement the same protocol.
- Retrieval supports byte or line ranges and cancellation so an agent can inspect only the needed portion.
- A persistence failure is a typed operational value and must not be reported as a successful shortened tool result.
Acceptance
- deterministic fixtures cover text, raw/binary content, exact-threshold behavior, failed persistence, and retrieval
- the append-only session retains both the original tool-result event and the artifact decision
- extensions can replace the policy and storage implementation without patching the agent loop
- ordinary small tool results preserve their current representation
Pi protects the conversation from oversized tool output by writing the complete result to a file and returning a bounded view. Rho needs the same observable behavior expressed through its artifact and async protocols.
Contract
Acceptance