Skip to content

Codex fork of a turnless parent is marked NeedsRetry forever #1582

Description

@dqtz5vpvj9-create

agentsview version

v0.41.1 (commit 55646d6); still present on main at d0395b5.

Install method

Built from source

OS / platform

Linux x86_64 (Debian-based)

Which agent and version

Codex Desktop 0.147.0 (source vscode)

Which model(s)

gpt-5.6-sol; the bug is model-independent

What happened, and what did you expect

What happened

Codex Desktop writes a rollout the moment a thread opens. Forking before the first prompt therefore produces a parent rollout that holds only session_meta and a thread_settings_applied event, with no turn_context at all. A chain of such forks (six sessions, three of them empty, one 221 MB) is sitting in a local archive.

codexParentResolution returns resolved && len(turnIDs) > 0, so a parent that exists and is fully readable but has no turn ids is treated exactly like a parent that cannot be found: the child is stamped DataVersionNeedsRetry with reason "codex parent turns unresolved" on every parse, and never reaches the current data version. Each pass re-parses the 221 MB rollout in full.

Before #1490 the retry also counted as a hard failure in collectAndBatch, which aborted every reconciliation page behind it; the archive logged watch root reconciliation failed processing page: 6 failures 7,977 times in one day. #1490 stops the abort from spreading, but the six forks stay permanently deferred and their fork lineage (parent_session_id) is never recorded, because linkSubagentSessions is gated on a clean pass.

This is distinct from #1476, whose parent transcript was genuinely missing. Here every parent is present.

Expected behavior

A parent that was read but never opened a turn has nothing to replay, so the fork should parse as current unless the child itself carries the copied parent session_meta (the positive sign that replayed history exists and the parent file is simply behind). Only an unreadable parent should defer the child.

Sample session file or snippet

Parent rollout (complete file, two lines):

{"type":"session_meta","payload":{"id":"<parent-id>","forked_from_id":null,"cli_version":"0.147.0","originator":"Codex Desktop", ...}}
{"type":"event_msg","payload":{"type":"thread_settings_applied", ...}}

Child rollout head:

{"type":"session_meta","payload":{"id":"<child-id>","forked_from_id":"<parent-id>", ...}}
{"type":"event_msg","payload":{"type":"thread_settings_applied", ...}}
{"type":"turn_context","payload":{"turn_id":"<child-turn>", ...}}

Steps to reproduce

  1. In Codex Desktop, open a new thread and fork it before sending a prompt; send prompts in the fork.
  2. Sync the Codex root.
  3. Observe the fork stays below the current data version with RetryReason "codex parent turns unresolved" on every pass, while doctor sync shows the parent present.

Fix in #1578.

Checklist

  • I searched existing issues
  • I removed secrets and private data from any attached session files

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions