fix(compress): prefer persisted reference handoff after completion — v0.50.90 (PR #699 by @franksong2702)

Fixes the /compress reference card showing only a short 3-line summary immediately after compression. Now prefers the persisted compaction message (full handoff) over the raw API summary, matching what is shown after page reload. Closes #695.
This commit is contained in:
nesquena-hermes
2026-04-18 21:29:07 -07:00
committed by GitHub
parent 3cd38b2b31
commit d3a686a266
3 changed files with 19 additions and 1 deletions

View File

@@ -155,3 +155,13 @@ def test_static_commands_js_registers_compress_alias(cleanup_test_sessions):
assert "/api/session/compress" in src
assert "cmdCompress" in src
assert "cmdCompact" in src
def test_static_commands_js_prefers_persisted_reference_message(cleanup_test_sessions):
from pathlib import Path
with open(Path(__file__).resolve().parents[1] / "static" / "commands.js", encoding="utf-8") as f:
src = f.read()
assert "const messageRef=referenceMsg?msgContent(referenceMsg)||String(referenceMsg.content||''):'';" in src
assert "const referenceText=messageRef || summaryRef;" in src