feat: save session transcripts when using Rust CLI (#845)

This adds support for saving transcripts when using the Rust CLI. Like
the TypeScript CLI, it saves the transcript to `~/.codex/sessions`,
though it uses JSONL for the file format (and `.jsonl` for the file
extension) so that even if Codex crashes, what was written to the
`.jsonl` file should generally still be valid JSONL content.
This commit is contained in:
Michael Bolin
2025-05-07 13:49:15 -07:00
committed by GitHub
parent 9da6ebef3f
commit 42617f8726
5 changed files with 239 additions and 0 deletions

11
codex-rs/Cargo.lock generated
View File

@@ -539,12 +539,14 @@ dependencies = [
"serde_json",
"tempfile",
"thiserror 2.0.12",
"time",
"tokio",
"tokio-util",
"toml",
"tracing",
"tree-sitter",
"tree-sitter-bash",
"uuid",
"wiremock",
]
@@ -4088,6 +4090,15 @@ version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821"
[[package]]
name = "uuid"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9"
dependencies = [
"getrandom 0.3.2",
]
[[package]]
name = "valuable"
version = "0.1.1"