agent-orchestrator/packages/plugins/agent-claude-code/src
Harsh Batheja be0ce0baac
fix(agent-claude-code): return idle state for freshly spawned sessions with no JSONL file (#891)
* fix(agent-claude-code): return idle state when no JSONL session file exists

Freshly spawned sessions had no Claude Code JSONL file yet (Claude Code
doesn't create it until the first conversation), causing getActivityState
to return null → displayed as 'unknown' in ao status.

When the process is running but no session file exists, return
{ state: 'idle', timestamp: now } so the dashboard shows the correct
state immediately after spawn.

Closes #883

* fix(agent-claude-code): use session.createdAt for idle timestamp when no JSONL file

Using new Date() as the timestamp caused isIdleBeyondThreshold to always
compute ~0ms, preventing stuck detection from ever firing for sessions that
hang before creating a JSONL file. Using session.createdAt correctly
represents when the session began, allowing stuck detection to eventually
trigger.
2026-04-03 19:44:59 +05:30
..
__tests__ fix(agent-claude-code): return idle state for freshly spawned sessions with no JSONL file (#891) 2026-04-03 19:44:59 +05:30
hook-script.integration.test.ts fix(agent-claude-code): detect cd-prefixed gh/git commands and use relative hook path 2026-03-08 10:42:45 +00:00
index.test.ts Merge pull request #463 from suraj-markup/feat/onboarding-improvements 2026-03-19 01:21:34 +05:30
index.ts fix(agent-claude-code): return idle state for freshly spawned sessions with no JSONL file (#891) 2026-04-03 19:44:59 +05:30