refactor: salvage adapter and CLI cleanup from PR #939

Salvaged from PR #939 by kshitij.

- deduplicate Discord slash command dispatch and local file send helpers
- deduplicate Slack file uploads while preserving thread metadata
- extract shared CLI session relative-time formatting
- hoist browser PATH cleanup constants and throttle screenshot pruning
- tidy small type and import cleanups
This commit is contained in:
kshitij 2026-03-14 02:56:06 -07:00 committed by teknium1
parent f279bb004f
commit 0bb7ed1d95
7 changed files with 164 additions and 282 deletions

View file

@ -267,8 +267,6 @@ class SessionDB:
if not title:
return None
import re
# Remove ASCII control characters (0x00-0x1F, 0x7F) but keep
# whitespace chars (\t=0x09, \n=0x0A, \r=0x0D) so they can be
# normalized to spaces by the whitespace collapsing step below
@ -373,7 +371,6 @@ class SessionDB:
Strips any existing " #N" suffix to find the base name, then finds
the highest existing number and increments.
"""
import re
# Strip existing #N suffix to find the true base
match = re.match(r'^(.*?) #(\d+)$', base_title)
if match: