From 6f1c8bf7a36eb7044ed7aad30f84664cbbf0d303 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Tue, 17 Mar 2026 11:28:19 +0200 Subject: Fix bugs, remove duplication, and clean up code quality issues - Log swallowed JSON unmarshal errors in stats and LSP handlers - Fix debug log file handle leak in tmuxedit (return closer from initDebugLog) - Check f.Close() errors on write paths in promptstore and tmuxedit - Fix cacheGet TOCTOU race by using single write lock - Fix readInput to use passed stdin reader instead of os.Stdin.Stat() - Remove 45 'moved to' comment tombstones from lsp/handlers.go - Deduplicate canonicalProvider wrappers (use llmutils.CanonicalProvider directly) - Remove SetWindow side effect from stats.TakeSnapshot (pure read now) - Move duplicated splitLines to textutil.SplitLinesBytes - Collapse StatusSink.SetGlobal 10 params into GlobalStatus struct - Simplify LRU touchLocked to in-place delete-and-append Co-Authored-By: Claude Opus 4.6 (1M context) --- internal/tmuxedit/history_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/tmuxedit/history_test.go') diff --git a/internal/tmuxedit/history_test.go b/internal/tmuxedit/history_test.go index b9d59d3..f6d6d7d 100644 --- a/internal/tmuxedit/history_test.go +++ b/internal/tmuxedit/history_test.go @@ -6,6 +6,8 @@ import ( "path/filepath" "testing" "time" + + "codeberg.org/snonux/hexai/internal/textutil" ) func TestAppendHistory(t *testing.T) { @@ -164,7 +166,7 @@ func TestSplitLines(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - got := splitLines([]byte(tt.input)) + got := textutil.SplitLinesBytes([]byte(tt.input)) gotStr := make([]string, len(got)) for i, b := range got { gotStr[i] = string(b) -- cgit v1.2.3