Transcript: a Codex turn header reads N previous messages over a mix, Worked for over one stretch

Merged
TE
5d ago
+133-3

Reply footer, part 3 of 3: Codex's turn header.

Leo, 2026-11-02: "compared to claude code our bottom thing looks bad ... i assume the x previous messages are when there's a mix and the worked for is if it's one contiguous thing. notice how on hover it reveals the exact timestamp. let's follow those."

A finished Codex turn's header now follows Codex:

  • "N previous messages ›" when the fold mixes the agent's own messages with its work. N counts the agent's messages, each call or thought in the work, and each received report. The answer stays below the header.
  • "Worked for 54s ›" when the fold is one stretch of work with no message between.

The chevron and hairline rule are the existing .cv-worked disclosure, unchanged. The turn.previous.one/other strings were already translated in Localizable.xcstrings, though nothing had set row.previous since turns without a summary stopped folding.

Codex turns only. Claude turns keep their per-run folding from #30176 and draw no header. #30176 is not reversed.

Code. turns.ts foldMixesMessages / foldedMessages set previous on the WORKED row, and workedLabel already reads it. The model.ts comment is updated.

Tests

  • New unit test conversation/codexHeader.test.ts: one stretch reads "Worked for 1m"; a mix of 5 calls and 1 note reads "6 previous messages"; a Claude turn draws no header.
  • New gallery variant agent-pane.transcript codex-turn-headers (a Codex chat). In Chromium the labels read ["5 previous messages", "Worked for 54s"]. Invariant and shift baselines were added for it.
  • 41 test files that mention "Worked for" or "previous message" were run at this tree and at base on the Linux pool: the same 7 failures on both (base reds), none new.
  • Typecheck and fmt are clean.

Viewed after image: yes. 2x captures of the new gallery variant in light and dark show "5 previous messages ›" over the first turn and "Worked for 54s ›" over the second, each with its hairline rule, and the answer below.

Agent session: agent session

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Finished Codex turns now draw a turn header that matches Codex's own: "N previous messages" when the fold mixes the agent's messages with its work, "Worked for 1m" when the fold is one contiguous stretch of work.

  • The header is Codex-only; Claude turns keep their per-run folding and draw no header.
  • Adds codexHeader.test.ts covering the mixed, contiguous, and Claude cases, plus a codex-turn-headers gallery variant with baselines.