When max_len is 0 or negative the cut pointer never advances, so the loop hangs. Return the content unsplit, matching truncate_text_to_tokens for non-positive budgets.
JSON APIs sometimes return numeric fields as strings; subtracting them raised TypeError and /status dropped the usage block.
Empty git commit messages made splitlines()[0] raise IndexError in format() and /dream-restore list rendering.