QueryCustody

works.iterative.claude.zio.internal.cli.QueryCustody
object QueryCustody

Custody for a query — a run that produces one result and then ends.

A query's CLI process exits when the run ends, so there is nothing to mirror until then and exactly one mirror to run: the archive hook's onClose. This wraps a run's message stream so that mirror fires when the stream is finished with, whether it ended in a result, an error, or an interruption.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def over(hook: SessionArchiveHook, resumedSessionId: Option[SessionId])(messages: ZStream[Any, CLIError, Message]): ZStream[Any, CLIError, Message]

Mirrors the transcript of messages once the stream is finished with.

Mirrors the transcript of messages once the stream is finished with.

The session mirrored is the one the run reported in its result. Until a result arrives the run is known only by resumedSessionId — the id the caller asked to resume — so a run that dies mid-stream still leaves the conversation it was appending to in the archive. A result supersedes it: on a resume the CLI can decline the id and mint a new one, and the new transcript is the one worth keeping. A run that names no session at all mirrors nothing.

Attributes