Skip to content

Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.

fix: add working→waitingForUser timeout when JSONL stops growing

libokaib2a7cb8b116b
diff --git a/CodePulse-macOS/Services/TranscriptWatcher.swift b/CodePulse-macOS/Services/TranscriptWatcher.swift
index 109121b8..1c8e5061 100644
--- a/CodePulse-macOS/Services/TranscriptWatcher.swift
+++ b/CodePulse-macOS/Services/TranscriptWatcher.swift
@@ -226,6 +226,7 @@ final class TranscriptWatcher {
private func updateTimeouts(_ tracker: inout SessionTracker) {
let now = Date()
+ let sinceLastActivity = now.timeIntervalSince(tracker.state.lastActivityTime)
// Permission heuristic: tool started but no result after timeout
if !tracker.activeToolIds.isEmpty,
@@ -237,9 +238,17 @@ final class TranscriptWatcher {
}
}
- // Idle timeout: no new data for a while after waiting
+ // Working but no new data → turn_duration was missed or hasn't arrived yet
+ if tracker.state.status == .working,
+ tracker.activeToolIds.isEmpty,
+ sinceLastActivity > idleTimeoutSeconds {
+ tracker.state.status = .waitingForUser
+ tracker.state.lastEvent = "Waiting for input"
+ }
+
+ // Waiting but no new data for even longer → truly idle
if tracker.state.status == .waitingForUser,
- now.timeIntervalSince(tracker.state.lastActivityTime) > idleTimeoutSeconds {
+ sinceLastActivity > idleTimeoutSeconds * 3 {
tracker.state.status = .idle
}
}