summaryrefslogtreecommitdiff
path: root/internal/hexailsp/run.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-09-17 21:33:45 +0300
committerPaul Buetow <paul@buetow.org>2025-09-17 21:33:45 +0300
commit88103657fb230bb41217a06aa5602ae23e7acb8b (patch)
tree524c437e4e40ee5d6713b6ea5414ad975654cc52 /internal/hexailsp/run.go
parent2b6232704ecc90630196b9f829f966533e5cdccd (diff)
feat(stats,tmux): global Σ@window stats across processes with flocked cache; width mitigation (narrow/maxlen); configurable [stats] window_minutes; robust coverage parsing; docs update\n\n- Add internal/stats with windowed event cache + flock + atomic writes\n- Wire stats into LSP/CLI/Tmux Action; tmux shows Σ@window with per-model tail\n- HEXAI_TMUX_STATUS_NARROW and HEXAI_TMUX_STATUS_MAXLEN for width control\n- Add [stats] window_minutes to config and apply on startup\n- Improve Magefile coverage handling; add tests to lift coverage >85%\n- Update docs/tmux.md and config example
Diffstat (limited to 'internal/hexailsp/run.go')
-rw-r--r--internal/hexailsp/run.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/hexailsp/run.go b/internal/hexailsp/run.go
index 92548b3..554e604 100644
--- a/internal/hexailsp/run.go
+++ b/internal/hexailsp/run.go
@@ -7,11 +7,13 @@ import (
"log"
"os"
"strings"
+ "time"
"codeberg.org/snonux/hexai/internal/appconfig"
"codeberg.org/snonux/hexai/internal/llm"
"codeberg.org/snonux/hexai/internal/logging"
"codeberg.org/snonux/hexai/internal/lsp"
+ "codeberg.org/snonux/hexai/internal/stats"
)
// ServerRunner is the minimal interface satisfied by lsp.Server.
@@ -37,6 +39,9 @@ func Run(logPath string, stdin io.Reader, stdout io.Writer, stderr io.Writer) er
if err := cfg.Validate(); err != nil {
logger.Fatalf("invalid config: %v", err)
}
+ if cfg.StatsWindowMinutes > 0 {
+ stats.SetWindow(time.Duration(cfg.StatsWindowMinutes) * time.Minute)
+ }
return RunWithFactory(logPath, stdin, stdout, logger, cfg, nil, nil)
}