ListSessions, GetSessionHistory, DeleteSession, and patchSessionSource
all ignored the Agent.codexHome config field and only checked the
CODEX_HOME environment variable. When codex_home was set in config.toml,
StartSession correctly wrote sessions to the custom directory, but the
listing functions searched the default ~/.codex/sessions/ — making all
sessions invisible.
- Add resolveCodexHomeDir helper (explicit config > env > default)
- Thread codexHome through listCodexSessions, findSessionFile,
getSessionHistory, and patchSessionSource
- Extract CODEX_HOME from session extraEnv for post-exit patching
Made-with: Cursor
Add patchSessionSource function to rewrite session_meta lines in Codex JSONL transcripts, changing source from "exec" to "cli" and originator to "codex_cli_rs" for CLI visibility. Includes tests for patching behavior and idempotency.
generated by llmgit
Co-Authored-By: Claude <noreply@anthropic.com>