Codeman icon indicating copy to clipboard operation
Codeman copied to clipboard

Home reports Idle while session-owned subagents are still running (Workflow status fix linked)

Open shenlvkang-collab opened this issue 1 month ago • 2 comments

Bug and suggested fix

When the main Claude session is quiet while one or more of its tracked subagents are still running, Home currently reports idle (or a stale waiting hook). This hides ongoing delegated work. The change shows workflow until the last child completes, while permissions/questions, errors and the main agent's own busy turn retain their existing priority.

Both Home screens and detailed sidebar/rail rows share the same classification. Children are matched against exact recorded Claude conversation IDs, including the tab's recorded conversation chain; window-placement guesses and shared working directories do not establish ownership. A watcher's idle child remains unfinished until its separate completion signal. Lifecycle events and reconnect snapshots refresh the UI, and workflow rows sort ahead of quiet rows using the earliest unfinished child's start time.

Validation:

  • 178 tests in 10 relevant suites, including lifecycle transitions, last-child completion, reconnect snapshots, ownership, pending questions, sorting and existing overview/rail behavior.
  • Typecheck, lint, frontend syntax, formatting and production build passed.
  • Playwright against the built application at 1440px and 390px verified visible Workflow pills and active styling, two children -> one -> Idle -> active transitions, permission priority and detailed rail rendering.

This uses the existing tracked-subagent feed and adds a presentation state; it does not change backend SessionStatus or autonomous respawn behavior. If tracking is disabled or no exact parent conversation is known, existing status behavior remains.

Reviewable implementation

Fork PR: https://github.com/shenlvkang-collab/Codeman/pull/2

Please consider the linked implementation as a possible fix. We attempted to create the PR directly against Ark0N/Codeman, but GitHub returned a CreatePullRequest permission error for this account, so the focused fork PR is linked here.

Reproduction: start a tracked Claude subagent, let the parent session return to its prompt while the child continues, then open Home. The parent is currently labeled idle/waiting even though delegated work is ongoing. Expected: Workflow (or another clear in-progress state), returning to Idle only after all tracked children finish.

shenlvkang-collab avatar Oct 24 '26 05:10 shenlvkang-collab

Thanks @shenlvkang-collab. Same story as #701: the CreatePullRequest error was GitHub's open pull request cap, and your account is on the bypass list now, so please open https://github.com/shenlvkang-collab/Codeman/pull/2 here as a normal PR against master with Fixes #703. The review will look closely at the ownership rule (exact recorded Claude conversation ids only), so the tests you list for that are the part worth keeping front and center in the PR description.

Ark0N avatar Oct 24 '26 11:10 Ark0N

@shenlvkang-collab, no PR came after the invitation above, so I looked at this myself, and I'm closing it for now. Here is why, and what would reopen it.

What Codeman does today. When Claude ends a turn while its own background agents or a workflow are still running, it draws a row like ✻ Waiting for 2 background agents to finish above the prompt. Codeman reads that row off the screen and keeps the session working until the row is gone (awaitingLine in the CLI registry). So when Claude itself says it is waiting for its workers, Home already shows the session as working.

What I could not see. A parent at a plain idle prompt, with no such row, while a child of its own still runs. The report has none from a real pane, and the tests on the fork branch build that state by hand. Without one I can't tell whether this is a state people reach.

Why I'm not taking the fork branch as it is. It counts a child as running while the subagent watcher has it as active or idle, and idle there only means the child's transcript file has not been written for 30 seconds. That is fine for drawing a subagent window, but it says little about whether the child is still working. The branch also shows Workflow in place of the yellow "waiting for you" state, so a session that needs an answer would stop saying so while a child is on the list.

To reopen this, reply with one real case: the Claude Code version, what the parent's pane shows at that moment (a screenshot or the text), and what Home showed for it. If Claude draws nothing there while a child runs, that is a gap worth closing and I'll pick it up.

Ark0N avatar Nov 12 '26 13:11 Ark0N