feat: show session chat history#115
Conversation
graykode
left a comment
There was a problem hiding this comment.
lgtm — security clean and actually defenses-positive: the new sanitize_terminal_text strips C0/C1 controls + bidi override/isolate marks before transcript text hits the TUI, and chat lines also pass through redact_secrets. tests cover both (BEL/RLO removal and sk-proj-secret → [REDACTED]).
pushed one merge commit (9884794) to resolve conflicts with main:
- #112 (
is_synthetic_user_msg) replaced this PR'sis_tool_result_user_msg. resolved by reusing the broaderis_synthetic_user_msgfor the chat-tail gating too — slash-command/bash/meta-caveat user lines are now also kept out of chat history, which matches the spirit of this PR (only show real user/assistant turns). - #113 (codex token comment) was a trivial co-located addition, kept both sides.
after merge, cargo build clean and all 128 tests pass on macOS, including this PR's three new tests and #112's slash-command thinking-window test.
one nit, non-blocking: clean_chat_text is duplicated between collector/claude.rs and collector/codex.rs and the truncation tail differs — claude uses truncate(…, max) which appends …, codex uses chars().take(max).collect() (no marker). worth unifying in a follow-up so users don't see one panel ellipsize and the other hard-cut.
(unrelated: cargo clippy --all-targets -- -D warnings still fails on src/ui/sessions.rs items-after-test-module, but that's pre-existing on main, not this PR.)
Summary
Show recent user/assistant chat history for the selected session.
Verification
cargo test chatcargo testcargo clippy -- -D warnings