From e9a68fe60356b0e70cea84ff5be08bd42576a5d1 Mon Sep 17 00:00:00 2001 From: Prateek Date: Mon, 16 Feb 2026 05:09:50 +0530 Subject: [PATCH] fix: return active instead of idle when JSONL entry is null When readLastJsonlEntry returns null (empty file or read error), getActivityState now returns "active" instead of "idle" as a conservative fallback. This makes it consistent with: - Other fallback cases in the same function (no workspace path, no session file) - Other agent plugins (Codex, OpenCode, Aider) which return "active" on detection failure - The stated intent in PR discussion to assume active when process is running Fixes bugbot comment: https://github.com/ComposioHQ/agent-orchestrator/pull/45#discussion_r2810110669 Co-Authored-By: Claude Sonnet 4.5 --- packages/plugins/agent-claude-code/src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/plugins/agent-claude-code/src/index.ts b/packages/plugins/agent-claude-code/src/index.ts index e96263011..a96e2b9ea 100644 --- a/packages/plugins/agent-claude-code/src/index.ts +++ b/packages/plugins/agent-claude-code/src/index.ts @@ -551,7 +551,10 @@ function createClaudeCodeAgent(): Agent { } const entry = await readLastJsonlEntry(sessionFile); - if (!entry) return "idle"; + if (!entry) { + // Empty file or read error, but process is running - assume active + return "active"; + } // Check staleness - no activity in 30 seconds means idle const ageMs = Date.now() - entry.modifiedAt.getTime();