Skip to content

"Log rotate" CODEX_HOME/history.jsonl #4963

@bolinfest

Description

@bolinfest

What version of Codex is running?

0.45.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

Currently, CODEX_HOME/history.jsonl grows without bound. If you use Codex a lot, this can get really long. We have seen folks accidentally feed in giant prompts that resulted in this file being gigabytes in size!

What is the expected behavior?

https://github.com/openai/codex/blob/main/docs/config.md#history was meant to have some sort of "max size" option that we honor (similar to how Bash history works).

Note that we do some stuff with advisory locking to ensure only one instance of Codex can write at a time. We also do some [possibly overengineered] work to ensure that each session of Codex CLI sees a consistent history as the user uses up/down to cycle through messages.

What do you see instead?

I see it grow without bound...

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions