Files
codex/codex-rs/external-agent-migration
charlesgong-openai bd2de422aa Parse Claude and Cursor session records separately (#35623)
## Why

Cursor session messages can place `<cursor_commands>` and `<timestamp>` context
before the actual `<user_query>`. Treating both external session formats with one
parser left that context in the imported message and generated title.

## What changed

- Route detected sessions through format-specific Claude and Cursor parsers.
- Strip recognized Cursor context wrappers when extracting a trailing
  `<user_query>`, while preserving messages with unknown leading context.
- Keep shared content-block, tool-call, and timestamp parsing in a common module.

## Testing

Add parser coverage for wrapped Cursor queries, unknown context, working-directory
precedence, Claude metadata, content hashing, and shared tool annotations.

GitOrigin-RevId: b49328d46ab4937e3c599588a3d3081e8ab798cd
2026-07-27 14:31:50 +00:00
..