createObservation
Purpose and behavior
Section titled “Purpose and behavior”Create a reusable observation client with optional persistence and borrowed sinks. Dispatch and workflow engines open independent tracking sessions and close them on settlement; the client exposes readRun and watchRun for the same transport. Construction performs no storage writes or execution. Sessions use separate event sequences, and checkpoint resumes preserve persistent cursors. close() waits for active sessions without cancelling execution. Low-level hubs and standalone readers remain compatible.
Complete example and detailed rules.
Parameters and properties
Section titled “Parameters and properties”optionsOptionalObservationOptions | undefinedOptional delivery, redaction, sink and persistence settings. With no transport, only in-memory observation is enabled. Sinks and transport are borrowed; no run is started by construction.options.transporterOptionalTransport | undefinedOptional caller-owned transport for run snapshots and events under runs/<id>/. Execution engines register and close tracking sessions; constructing a client or reading never creates records. Without it, readRun and watchRun refuse.options.heartbeatMsOptionalnumber | undefinedTracking heartbeat interval in milliseconds, default 5000, a positive safe integer within the timer range. Applies only to recorded running executions.options.abandonAfterMsOptionalnumber | undefinedHeartbeat expiry delay in milliseconds, default 30000; must exceed heartbeatMs. Expiry reports suspected abandonment on read, never recovery authorization.options.redactOptionalreadonly RegExp[] | undefinedRegular expressions applied recursively to event strings, keys and scope strings before delivery. Each rule replaces all matches; its lastIndex is preserved.options.sinksOptionalreadonly ObservationSink[] | undefinedReceivers attached to this root and inherited by every child.options.scopeOptionalObservationScope | undefinedInitial correlation fields; child scopes override only explicitly supplied fields.options.capacityOptionalnumber | undefinedMaximum events waiting per asynchronous sink, default 1024; on overflow the newest are dropped and counted. A value that is not a positive integer throws.options.deliveryTimeoutMsOptionalnumber | undefinedMaximum wait for one asynchronous delivery or sink flush, default 5000; a sink that exceeds it is disabled for the hub’s lifetime. A value that is not a positive integer throws.options.verboseOptionalboolean | undefinedExplicitly allow full model request/response events. Does not enable verbose journal retention by itself.

