fix(cli): show full session titles in /resume list

This commit is contained in:
LeonSGP43 2026-04-23 02:17:35 +08:00 committed by Teknium
parent 8e68426981
commit 6c44d537cc
2 changed files with 29 additions and 1 deletions

View file

@ -360,6 +360,34 @@ class TestHistoryDisplay:
os.environ.pop("HERMES_SESSION_ID", None)
_VAR_MAP["HERMES_SESSION_ID"].set(_UNSET)
def test_resume_list_shows_full_long_titles(self, capsys):
"""Long session titles render in full in the /resume table — not
truncated to 30 chars (fixes #14082)."""
cli = _make_cli()
cli.session_id = "current"
cli._session_db = MagicMock()
long_title = "Salvage BytePlus Volcengine PR With Fixes"
cli._session_db.list_sessions_rich.return_value = [
{
"id": "current",
"title": "Current",
"preview": "Current preview",
"last_active": 0,
},
{
"id": "20260401_201329_d85961",
"title": long_title,
"preview": "fix byteplus pr and resume",
"last_active": 0,
},
]
cli._handle_resume_command("/resume")
output = capsys.readouterr().out
assert long_title in output
assert "20260401_201329_d85961" in output
def test_sessions_command_no_args_lists_recent_sessions(self, capsys):
"""/sessions with no args prints the recent-sessions table (TUI parity).