mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +00:00
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.
This commit is contained in:
parent
8d756a4210
commit
7282ef1b9d
1 changed files with 2 additions and 0 deletions
2
cli.py
2
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue