Skip to content

fix: flatten multiline session titles before printing - #3

Merged
EchoTreee merged 1 commit into
mainfrom
fix/multiline-title
Sep 17, 2026
Merged

EchoTreee merged 1 commit into
mainfrom
fix/multiline-title

Conversation

@EchoTreee

Copy link
Copy Markdown
Owner

问题

会话标题可能包含换行(例如粘贴进来的一大段多步 prompt)。resume 之前用 wc -l 数行数来判定「唯一命中还是多条命中」,结果一条多行标题的会话被数成了多行——比如一条标题有 18 行的会话,报成「匹配到 18 条」。

改动

  • resume 和 sessions 在打印前把标题里的换行、回车、制表符压平为空格(resume 再截断到 60 字),让「一行 = 一条」。
  • 新增 tests/test_smoke.py::test_resume_multiline_title_counts_once。
  • 更新 CHANGELOG。

验证

  • python3 tests/test_smoke.py:10 个测试全过。
  • 真机复现:标题 18 行的会话现在正确显示为单条命中,不再误报 18 条。

A session title can contain newlines (e.g. a pasted multi-step prompt), so counting lines to decide single-vs-multiple matches miscounted one session as many. Flatten newlines/tabs in titles in both resume and sessions.
@EchoTreee
EchoTreee merged commit be3f3ca into main Sep 17, 2026
2 checks passed
@EchoTreee
EchoTreee deleted the fix/multiline-title branch September 17, 2026 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant