Sessions are related in several independent ways. A session may have been spawned by another (delegation), may have been forked from another (divergence), may continue another (after a compaction or reset), may have had its turns run by another (an app driving a coding agent), and may contain copies of another’s records. All of these can be true at once, possibly involving different sessions. A single “relation” field would force a producer to pick one and misstate the rest. ASR records each relation as an independent facet with its own evidence.

Lineage facets

The header’s lineage object holds the facets. Every facet is optional.
This is the header of the subagent that the example session spawned with tool call toolu_01Z. Its session ID is the subagent’s own agentId, as the registry specifies. session values are session references (SessionRef). record values are references (ASR-062) using IDs from the referenced session. These references are written without percent-encoding, for example callId=toolu_01Z. ASR-400 Each of spawnedBy, forkedFrom, continues, inherits and relatedUnknown, when present, MUST be an object with evidence, each entry of executedBy MUST be an object with session and evidence, and every session member MUST be a valid session reference without a # part. ASR-401 An absent lineage, or an absent facet, means unknown. Readers MUST NOT infer that a session is a root, or that it has no parent, from the absence of facets. ASR-402 root: true MUST NOT appear together with spawnedBy, forkedFrom, continues, relatedUnknown, or inherits with mode copied, referenced or rendered. (executedBy does not name a parent and may appear with root.) A producer MAY claim root only when the agent’s registry entry documents how the source positively distinguishes root sessions.

Evidence

ASR-403 Facets MUST be asserted only from positive evidence. A producer MUST NOT infer lineage from similar content, similar timing, shared working directories or file proximity. ASR-404 evidence MUST be native_field, native_structure or converter_inference. converter_inference MUST be used only under a rule published in the agent’s registry entry. ASR-405 When the source has a parent pointer whose meaning it does not record, the producer MUST use relatedUnknown and MUST NOT guess spawnedBy, forkedFrom or continues.

Claims owned by the child

Lineage references are claims made by the child. The sessions they point to do not have to be available. ASR-406 A missing or unresolvable parent MUST NOT make a child stream invalid. Readers MUST tolerate lineage references to sessions they do not have, and report them as unresolved. A producer never has to emit the parent to emit a valid child, and a change to a parent never requires rewriting its children.

forkedFrom, continues and inherits

This Codex subagent was spawned by its parent thread and started from the parent’s history up to ordinal 411, which it references rather than copies. Both facets hold at once. ASR-407 forkedFrom MUST contain at most one of record or ordinal. ordinal is the source’s native ordinal (an integer) of the last shared record, inclusive. continues.reason values: OpenClaw records each of these as the reason a conversation moved to a new window, and each window is a session. The conversation as a whole has a conversationKey (see Session records). ASR-408 continues.reason MUST be one of the values above or a vendor value. inherits.mode values: ASR-409 inherits MUST contain mode. When mode is copied, referenced or rendered it MUST contain from. It MUST contain at most one of throughId or throughOrdinal, both in the ancestor’s ID or ordinal space and inclusive. localThroughId MUST appear only with mode copied, and MUST be the record ID of a record in this stream.

executedBy

Some apps run their conversations through other agents. T3 Code keeps its own thread and drives a Claude Code or Codex session to do the work; OpenClaw can run a conversation through Codex or the Claude Code CLI. Each side records the work in its own way. The wrapper (the app) records who asked, how turns were queued and approved, and what it showed; the backing session records the model calls and tool executions. executedBy links them: the wrapper’s stream names the sessions that ran its turns.
This T3 Code thread was run by one Codex session. A declaration adds an entry when the thread switches to another backing session, and each turn’s state record can name the backing session’s own turn (state.executedBy, see Session records). executedBy is not spawnedBy, forkedFrom or continues: the backing session did not create, branch or precede the wrapper’s session. Records the wrapper copied from a backing session carry copiedFrom. Records the wrapper owns (who asked, approvals it routed, its own notices) are its own, and keep their originality under the normal rule (see Originality). executedBy uses the same evidence values as the other facets. ASR-420 executedBy MUST be an array. A declaration’s executedBy adds entries to the effective facet (a set union by session). ASR-421 executedBy and state.executedBy MUST come from source evidence that the named session ran this session’s turns (a stored native session ID, a stored native turn ID). A producer MUST NOT infer them from matching text or timing.

Mirrors

A mirror stream is a copy, kept by another program, of one session: OpenClaw keeps a transcript of each conversation it runs through the Codex app-server, while the Codex thread holds the primary record. The header says so with authority: "mirror" and names the mirrored session in executedBy. ASR-422 A stream with authority: "mirror" MUST have a lineage.executedBy with exactly one entry, and the producer MUST use mirror only when source evidence, documented in the agent’s registry entry, shows that the whole stream copies that session. executedBy alone is not such evidence. ASR-423 In a mirror stream, a record without copiedFrom has unknown originality (ASR-416), whatever the stream’s inherits. In any other stream with executedBy, a record is a copy only when it carries copiedFrom or lies in a declared inherited prefix; being in a wrapper’s stream does not make a record a copy.

Scope and role

scope (a header field, not a facet) says whether the session is a top-level session or a subagent: primary or subagent. It is independent of the facets. An interactive fork or a resumed session is primary; a delegated child is a subagent; a subagent created by forking its parent’s context is a subagent with both spawnedBy and forkedFrom. A top-level session that another session’s agent created (T3 Code’s create_threads) has spawnedBy and scope: primary: spawnedBy does not imply a subagent. ASR-410 Producers MUST set scope only from the source, and MUST NOT infer it from the presence of a parent, a role name or a facet.

subagent

A parent stream announces a child session with a subagent record. A child that runs in the background changes state after it is announced: it finishes, fails, is stopped by the user, or is resumed. Each change the source records is a revision of the subagent record.
The second and third records come from a T3 Code thread run by Claude Code that delegated a task to a new thread run by Codex. The child’s T3 thread ID contains : and %, which its session reference encodes (see the registry). Capture state key: childSession. ASR-411 A subagent record MUST contain childSession, a session reference without a # part, unless capture.childSession is present. ASR-412 When both sides positively name a delegation, they SHOULD agree on the delegating call. Validators warn on incompatible positive claims unless a MUST rule requires an error. One-sided evidence is not a contradiction. If a parent stream is present but has no spawn announcement and no declared lineage loss, validators report one notice per parent session. ASR-424 A change of a child’s state MUST be recorded as a revision (supersedes) of the subagent record for that delegation, never as a second announcement. status, model and agent MUST come from the source.

Copies

Many harnesses physically copy history into a new session on fork, branch, resume or continuation. If copies are counted as new work, a child is credited with its parent’s tokens, costs, edits and commits. ASR marks copies explicitly, by positive evidence only.

copiedFrom

A copy can be of a record in the same stream. OpenClaw writes a delivered reply into the conversation again as a separate row (a delivery mirror). That row is a message with copiedFrom: {"record": "messageId=<original>", "proof": "native_field"}, so it is not counted as a second reply. ASR-413 copiedFrom MUST contain proof, one of the values above, and MUST contain session or record or both. Resolution follows the reference-resolution table. A local target MUST have a lower seq. ASR-414 A producer MUST mark a record as copied only when supported by one of these proofs. Similar text, timestamps, roles, tool names or payloads are never proof of a copy. A wrapper can know the source session without knowing a native record ID:
ASR-427 A copied run or turn ID alone MUST NOT establish which session owns a fact in a separate store. Without independent native evidence of ownership, producers MUST leave that fact unassigned and keep it at the registry destination. Consumers MUST deduplicate copied usage, costs and side facts through lineage under ASR-417.

Inherited prefixes

Instead of marking each copy, the header can declare that the stream begins with copied history: inherits.mode: "copied" with localThroughId naming the last copied record in this stream. ASR-415 When the effective inherits has mode copied and localThroughId, every record with a seq at or below that record’s seq, other than the header and declaration records, is a copy, whether or not it carries copiedFrom.

Originality

A record is original to its session (its usage, cost, file changes and VCS actions are that session’s work) only when:
  1. it has no copiedFrom;
  2. it is not within a declared inherited prefix (ASR-415);
  3. the session’s effective inherits.mode is none, referenced or rendered, or is copied with localThroughId declared; and
  4. the stream’s authority is not mirror (ASR-423).
In every other case (no lineage, mode unknown, mode copied without a declared prefix, or a mirror stream), the record’s originality is unknown. The absence of copiedFrom does not establish that the record is original. ASR-416 Consumers MUST determine originality by the rule above. Consumers that attribute work to sessions (blame, production credit) MUST NOT credit a session with records whose originality is unknown. Consumers that report totals including such records MUST say that the totals may include copies.

Counting rules

ASR-417 Consumers MUST NOT count the usage, cost, file changes, VCS actions or commits of copied records as the work of the session that holds the copies. Copies can still be searched and displayed; search results SHOULD label or collapse them. ASR-418 Usage and cost of new model calls that process inherited context are the inheriting session’s own, even though the inherited records are not. ASR-419 A subagent’s records are the subagent’s work. Consumers computing a parent’s total MUST NOT add its children’s totals to a parent aggregate that already includes them, and MUST follow the usage rules for parent and child aggregates (ASR-321, ASR-322). ASR-425 Usage and cost that a wrapper’s stream reports for turns a backing session ran (through executedBy) cover that backing session’s model calls. A consumer totaling both streams MUST use either the wrapper’s aggregates or the backing session’s records, never both (ASR-321). ASR-426 A message that renders inherited context (inherits.mode: "rendered", or a message with derivedFrom) is new content of its own session, not a copy. Its source records keep their own originality.