Skip to content

Persist oversized tool results as typed artifacts #3

Description

@sounkou-bioinfo

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions