Commit Graph

2 Commits

  • 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.