Claude Code imports lose original session timestamps

Open 💬 0 comments Opened Jul 11, 2026 by andrew05060414

Description

Importing Claude Code sessions through the external-agent import flow assigns the import time to every imported thread. Older conversations therefore appear at the top of the Codex task list as if they were created today.

Reproduction

  1. Have a Claude Code JSONL session containing messages from an earlier date.
  2. Import it into Codex using the Claude Code session import flow.
  3. Inspect the imported task in the Codex task list or the persisted thread metadata.

Expected behavior

The imported thread preserves the source session time range: the first valid message timestamp as created_at and the last valid message timestamp as updated_at.

Actual behavior

Both fields use the time of import, so all imported sessions sort to the top together.

In one local reproduction, a source session beginning on 2026-06-11 was imported on 2026-07-11 and appeared with 2026-07-11 thread metadata.

Root cause

codex-rs/external-agent-sessions already parses timestamps for individual messages, but codex-rs/app-server/src/request_processors/external_agent_session_import.rs currently persists created_at: Some(now) and updated_at: Some(now).

Suggested fix

Carry optional source created_at and updated_at values through ImportedExternalAgentSession, derived from the first and last valid source message timestamps. Use them when creating thread metadata, with the current behavior as fallback when timestamps are absent or invalid.

I have validated this approach locally with unit and app-server tests.

View original on GitHub ↗