From 7282ef1b9d4ba9b77057f53ca92cbb2ed674129b Mon Sep 17 00:00:00 2001 From: LifeJiggy Date: Fri, 15 May 2026 19:39:29 +0100 Subject: [PATCH] fix: add paste collapse logging to aid debugging Adds logger.info when large pastes are collapsed to file references in both paste-code paths (handle_paste and _on_text_changed). Logs paste ID, line count, character count, and file path so operators can correlate missing- content reports with specific paste files. This is a diagnostic aid, not a fix for the paste-drop issue. --- cli.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli.py b/cli.py index c1ba1c0ddd2..42b1482578e 100644 --- a/cli.py +++ b/cli.py @@ -12604,6 +12604,7 @@ class HermesCLI: paste_dir.mkdir(parents=True, exist_ok=True) paste_file = paste_dir / f"paste_{_paste_counter[0]}_{datetime.now().strftime('%H%M%S')}.txt" paste_file.write_text(pasted_text, encoding="utf-8") + logger.info("Collapsed paste #%d: %d lines, %d chars -> %s", _paste_counter[0], line_count + 1, len(pasted_text), paste_file) placeholder = f"[Pasted text #{_paste_counter[0]}: {line_count + 1} lines \u2192 {paste_file}]" prefix = "" if buf.cursor_position > 0 and buf.text[buf.cursor_position - 1] != '\n': @@ -12771,6 +12772,7 @@ class HermesCLI: paste_dir.mkdir(parents=True, exist_ok=True) paste_file = paste_dir / f"paste_{_paste_counter[0]}_{datetime.now().strftime('%H%M%S')}.txt" paste_file.write_text(text, encoding="utf-8") + logger.info("Collapsed paste #%d: %d lines, %d chars -> %s (fallback)", _paste_counter[0], line_count + 1, len(text), paste_file) _paste_just_collapsed[0] = True buf.text = f"[Pasted text #{_paste_counter[0]}: {line_count + 1} lines \u2192 {paste_file}]" buf.cursor_position = len(buf.text)