redactSlash strips the /hamrpass bearer token before it lands in any log. A central hook covers any future secret-bearing command from one place. The split mirrors runSlash's strings.Fields: both must agree on command vs. args, else a multi-line `/hamrpass\n ` (Alt+Enter inserts a literal
(line string)
| 65 | // timestamp carries the date too (not just the clock) so a shared log is |
| 66 | // unambiguous across day boundaries and correlatable with other tooling. |
| 67 | func dbgWritef(category, format string, args ...any) { |
| 68 | dbgMu.Lock() |
| 69 | defer dbgMu.Unlock() |
| 70 | if dbgFile == nil { |
| 71 | return |
| 72 | } |
| 73 | ts := time.Now().Format("2006-01-02 15:04:05.000") |
| 74 | body := fmt.Sprintf(format, args...) |
| 75 | fmt.Fprintf(dbgFile, "[%s] %s\n%s\n\n", ts, category, body) |
| 76 | } |
| 77 | |
| 78 | // dbgWriteSession records the active backend and context budget once at startup. |
| 79 | // Behaviour differs sharply by model (different model families fail in |
no outgoing calls