76e83445f728c673ea099638a7cd85abc02dfdbe

Author
TheEdgeOfRage <git@theedgeofrage.com>
Committer
TheEdgeOfRage <git@theedgeofrage.com>
Date

Message

Make raw log optional

Diff

 1diff --git a/.gitignore b/.gitignore
 2index b15f4afba4423fa646ea1561d995a8026ca6ab60..c4f603b7be49bce5842a50c43d2237788de72a52 100644
 3--- a/.gitignore
 4+++ b/.gitignore
 5@@ -12,3 +12,6 @@
 6 
 7 # Model weights
 8 /models/
 9+
10+# Log
11+kaiwari_raw.log
12diff --git a/internal/adapters/llm.go b/internal/adapters/llm.go
13index 92a73f74bc67d2c0c72031eb45d2f55e11a046ff..3cd743b8c8fffa064225227be9dd2d0c1194b851 100644
14--- a/internal/adapters/llm.go
15+++ b/internal/adapters/llm.go
16@@ -19,6 +19,8 @@ import (
17 // owns the terminal and direct stderr writes get mangled by redraws.
18 const rawLogPath = "kaiwari_raw.log"
19 
20+var rawLogEnabled = os.Getenv("DEBUG")
21+
22 // Per-call model timeouts, applied via context so a slow call cannot hang a turn
23 // or exhaust a shared client deadline. Compaction reads long closed segments so it
24 // gets the largest budget; world turns next; one-shot side tasks are fast.
25@@ -29,6 +31,9 @@ const (
26 )
27 
28 func dumpRaw(label, transcript, raw string) {
29+	if rawLogEnabled != "1" {
30+		return
31+	}
32 	f, err := os.OpenFile(rawLogPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o644)
33 	if err != nil {
34 		return