SIGN IN SIGN UP

fix(codex): give a forked session the history it inherited

codex-acp 1.8.0 forks BY REFERENCE. The child's rollout holds no
history at all — `session_meta` names `forked_from_id` and
`forked_from_ordinal_exclusive`, and everything before that cut stays in
the parent's file. Read on its own it parses to zero turns, so every
`[Fork] …` row rendered "this session has no messages" while its history
sat one file away. Splice the parent's stream below the cut back in.

Older forks are the opposite shape — they replay the parent inline, and
that replayed second `session_meta` is what `is_forked_thread_header`
already keys off. `forked_from_ordinal_exclusive` is what separates the
two: on disk only the by-reference shape carries it. The ordinal filter
then makes the distinction self-enforcing rather than a bet — the parent
contributes only ordinals below the cut and the child only its own at or
above it, so a child that did replay inline cannot end up holding the
history twice.

Assembly order reproduces codex's own inline shape (child header, parent
stream, child body) because both parsers latch `parent_id` from the first
header they see, and the child's is the one declaring the lineage. A
parent that no longer exists on disk degrades to today's behaviour
instead of failing the conversation, and the hop count is bounded.

Claude is unaffected: its SDK copies the history into the new transcript.
X
xintaofei committed
17e60fc9bd47723ed4c53811fa2ec605bbdb540e
Parent: 1c3b8eb