Files
codex/codex-rs/connectors/src/metadata.rs
T
Eric Traut 56958f2512 Seed prompt history from resumed messages (#24298)
## Why

When the TUI resumes a thread, transcript replay renders prior user
messages but did not seed the composer history. That leaves the resumed
session with empty in-memory prompt history, so pressing Up can fall
through to persisted global history and surface a prompt from another
thread.

The expected behavior is that prompts from the resumed thread are
recalled first, with global history only as a fallback.

## What changed

- Record replayed user messages into the composer history during resume
replay.
- Preserve the existing persisted history format and avoid any startup
history scan.
- Add focused TUI coverage showing replayed prompts are recalled before
persisted global history.

## Validation

- Added `replayed_user_messages_seed_composer_history` in
`codex-rs/tui/src/chatwidget/tests/history_replay.rs`.
- `just test -p codex-tui replayed_user_messages_seed_composer_history`
passed.
2026-05-28 22:08:05 -07:00

32 lines
929 B
Rust

use codex_app_server_protocol::AppInfo;
pub fn connector_display_label(connector: &AppInfo) -> String {
connector.name.clone()
}
pub fn connector_mention_slug(connector: &AppInfo) -> String {
connector_mention_slug_from_name(&connector_display_label(connector))
}
pub fn connector_mention_slug_from_name(name: &str) -> String {
crate::connector_name_slug(name)
}
pub fn connector_install_url(name: &str, connector_id: &str) -> String {
crate::connector_install_url(name, connector_id)
}
pub fn sanitize_name(name: &str) -> String {
crate::connector_name_slug(name).replace("-", "_")
}
pub(crate) fn sort_connectors_by_accessibility_and_name(connectors: &mut [AppInfo]) {
connectors.sort_by(|left, right| {
right
.is_accessible
.cmp(&left.is_accessible)
.then_with(|| left.name.cmp(&right.name))
.then_with(|| left.id.cmp(&right.id))
});
}