Skip to content

Move message history out of core#21278

Merged
pakrym-oai merged 2 commits into
mainfrom
pakrym/message-history-crate
May 6, 2026
Merged

Move message history out of core#21278
pakrym-oai merged 2 commits into
mainfrom
pakrym/message-history-crate

Conversation

@pakrym-oai
Copy link
Copy Markdown
Collaborator

Why

Message history was implemented inside codex-core and surfaced through core protocol ops and SessionConfiguredEvent fields even though the current consumer is TUI-local prompt recall. That made core own UI history persistence and exposed history_log_id / history_entry_count through surfaces that app-server and other clients do not need.

This change moves message history persistence out of core and keeps the recall plumbing local to the TUI.

What changed

  • Added a new codex-message-history crate for appending, looking up, trimming, and reading metadata from history.jsonl.
  • Removed core protocol history ops/events: AddToHistory, GetHistoryEntryRequest, and GetHistoryEntryResponse.
  • Removed history_log_id and history_entry_count from SessionConfiguredEvent and updated exec/MCP/test fixtures accordingly.
  • Updated the TUI to dispatch local app events for message-history append/lookup and keep its persistent-history metadata in TUI session state.

Validation

  • cargo test -p codex-message-history -p codex-protocol
  • cargo test -p codex-exec event_processor_with_json_output
  • cargo test -p codex-mcp-server outgoing_message
  • cargo test -p codex-tui
  • just fix -p codex-message-history -p codex-protocol -p codex-core -p codex-tui -p codex-exec -p codex-mcp-server

@pakrym-oai pakrym-oai marked this pull request as ready for review May 6, 2026 00:54
@pakrym-oai pakrym-oai requested a review from a team as a code owner May 6, 2026 00:54
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4ae2d0e54

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/message-history/Cargo.toml Outdated
Comment thread codex-rs/tui/src/app/thread_routing.rs Outdated
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Executed happy path smoke test sending messages and making sure we can recall them from history both in the same and new sessions.

Code looks good, approved.

@pakrym-oai pakrym-oai merged commit 2004173 into main May 6, 2026
29 checks passed
@pakrym-oai pakrym-oai deleted the pakrym/message-history-crate branch May 6, 2026 15:35
@github-actions github-actions Bot locked and limited conversation to collaborators May 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants