Skip to content

estack-read-agent-history: --mode lookup resolves a branched Codex session to the empty parent stub #48

Description

@ElliotDrel

What happened

On 2026-09-15 I tried to read back a Codex session that --mode timeline had just reported as the biggest block of the morning:

10:23am-11:51am (1h27m)
   - codex > Purdue School Stuff - (untitled) [01a0a571] - 231 msgs

--mode lookup --uuid 01a0a571 returned:

C:\Users\2supe\.codex\sessions\2026\09\15\rollout-2026-09-15T10-21-22-01a0a571-a14c-7c02-a0ba-03ebe8f1459e.jsonl

and both --mode dump and --mode brief on that path reported an empty session:

[rollout-2026-09-15T10-21-22-01a0a571-....jsonl - 0 entries]
--- Conversation dump (0 of 0 messages, user only) ---

01a0a571-... - Purdue School Stuff - 2026-09-15 10:21 - clean
intent: (no user prompts)
last:   (no assistant messages)
edits:  0 files - (none)
tools:  (none)

Root cause

That rollout file is a 10-line stub (session_meta, turn_context, world_state, a few developer preambles, and a turn_aborted). The real conversation lives in a branched rollout whose filename carries two UUIDs:

rollout-2026-09-15T10-21-22-01a0a571-a14c-7c02-a0ba-03ebe8f1459e.jsonl                                        (10 lines, stub)
rollout-2026-09-15T10-23-12-01a0a571-a14c-7c02-a0ba-03ebe8f1459e_01a0a573-4e80-7db2-8643-3c23a2acd5a5.jsonl   (1444 lines, real)

timeline clearly aggregates the branch into the parent's msg count (231), but lookup picks the first/earliest file matching the UUID prefix and lands on the stub. So the two modes disagree about the same session.

Expected

--mode lookup --uuid <prefix> should resolve to the rollout that actually holds the conversation, or return every file in the branch chain so dump/brief can be pointed at the right one. At minimum, brief reporting "0 entries / no user prompts" for a session timeline just called 231 messages should not be silent -- it reads as "nothing happened here" when the transcript is fully intact.

Impact

This cost a detour during an Akiflow backfill. The workaround was a hand-rolled script globbing ~/.codex/sessions/2026/09/15/*.jsonl and pulling response_item / message / role: user payloads directly -- exactly the hand-rolled parsing the skill tells you never to do.

Environment

Windows 11, ELLIOT-SCHOOL, Codex CLI 0.154.0-alpha.6.2, rollouts under C:\Users\2supe\.codex\sessions\.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions