refactor(hermes_cli): second pass on the 15 small modules — compact bodies, drop redundant locals/blanks, tighten module docs

This commit is contained in:
Teknium
2026-09-02 21:20:42 -07:00
parent 416a1c1acd
commit fc51206750
14 changed files with 159 additions and 394 deletions
+5 -6
View File
@@ -42,12 +42,11 @@ def collapse_repeated_input_artifacts(text: str, min_repeats: int = 4) -> str:
index -= len(marker)
if repeat_count < min_repeats:
return text
start = index
if start >= 2 and text[start - 2 : start] == "[e":
start -= 2
elif start >= 1 and text[start - 1] == "[":
start -= 1
return text[:start]
if index >= 2 and text[index - 2 : index] == "[e":
index -= 2
elif index >= 1 and text[index - 1] == "[":
index -= 1
return text[:index]
def sanitize_user_prompt_text(text: str) -> str: