Co-authored-by: Clément Drouin <clement.drouin@mistral.ai>
Co-authored-by: Kim-Adeline Miguel <51720070+kimadeline@users.noreply.github.com>
Co-authored-by: Mathias Gesbert <mathias.gesbert@mistral.ai>
Co-authored-by: allansimon-mistral <allan.simon@ext.mistral.ai>
Co-authored-by: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Clément Sirieix 2026-05-07 13:55:56 +02:00 committed by GitHub
parent 4972dd5694
commit b23f49e5f4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
74 changed files with 2342 additions and 240 deletions

View file

@ -0,0 +1,28 @@
from __future__ import annotations
from unittest.mock import MagicMock
from vibe.cli.textual_ui.widgets.compact import CompactMessage
from vibe.core.session.session_id import shorten_session_id
class TestCompactMessage:
def test_get_content_includes_session_ids_after_compaction(self) -> None:
message = CompactMessage()
message.post_message = MagicMock()
message.set_complete(
old_tokens=177_017,
new_tokens=23_263,
old_session_id="11111111-1111-1111-1111-111111111111",
new_session_id="22222222-2222-2222-2222-222222222222",
)
assert message.get_content() == (
"Compaction complete: 177,017 → 23,263 tokens (-87.%)\n"
"session: "
f"{shorten_session_id('11111111-1111-1111-1111-111111111111')} "
"(before compaction) → "
f"{shorten_session_id('22222222-2222-2222-2222-222222222222')} "
"(after compaction)"
)