The fork detector added in #9 identifies a resumed session's forked rollout by cwd + copied-history item-id overlap. This is a heuristic: it works because a reconstructed rollout copies prior history verbatim, but:
- it cannot follow a fork that copies no history,
- it depends on opaque item ids and a same-cwd co-requirement,
- it needs a bounded watch window and a lineage threshold tuned by hand.
The robust long-term fix is an explicit identity instead of content inference:
- Codex writes a stable resume-lineage id into
session_meta (a forked/reconstructed rollout records the id of the session it descends from), or
- Agent Code obtains the provider session id over an explicit Codex API and the tailer attaches by that id rather than by filename / cwd / content.
Either removes the heuristic entirely. Tracked from the in-code comment in tailResumeRolloutFile ("The stronger long-term fix is for Codex to write a stable resume lineage id…").
Refs #9, Juliusolsson05/agent-code#159.
The fork detector added in #9 identifies a resumed session's forked rollout by cwd + copied-history item-id overlap. This is a heuristic: it works because a reconstructed rollout copies prior history verbatim, but:
The robust long-term fix is an explicit identity instead of content inference:
session_meta(a forked/reconstructed rollout records the id of the session it descends from), orEither removes the heuristic entirely. Tracked from the in-code comment in
tailResumeRolloutFile("The stronger long-term fix is for Codex to write a stable resume lineage id…").Refs #9, Juliusolsson05/agent-code#159.