mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
Move message history out of core (#21278)
## 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`
This commit is contained in:
@@ -103,13 +103,6 @@ pub(crate) enum AppCommand {
|
||||
Review {
|
||||
target: ReviewTarget,
|
||||
},
|
||||
AddToHistory {
|
||||
text: String,
|
||||
},
|
||||
GetHistoryEntryRequest {
|
||||
offset: usize,
|
||||
log_id: u64,
|
||||
},
|
||||
ApproveGuardianDeniedAction {
|
||||
event: GuardianAssessmentEvent,
|
||||
},
|
||||
@@ -275,14 +268,6 @@ impl AppCommand {
|
||||
Self::Review { target }
|
||||
}
|
||||
|
||||
pub(crate) fn add_to_history(text: String) -> Self {
|
||||
Self::AddToHistory { text }
|
||||
}
|
||||
|
||||
pub(crate) fn history_lookup(offset: usize, log_id: u64) -> Self {
|
||||
Self::GetHistoryEntryRequest { offset, log_id }
|
||||
}
|
||||
|
||||
pub(crate) fn approve_guardian_denied_action(event: GuardianAssessmentEvent) -> Self {
|
||||
Self::ApproveGuardianDeniedAction { event }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user