Skip to content

[bug] inspect reports live: Dead for detached-run workers that are running #47

Closed

Description

@smota

Summary

For a detached run, meshloop inspect reports each running worker as "live": "Dead" while the worker process is alive and making progress.

Version / OS

meshloop 0.3.0, origin/main @ 2769f08. Windows 11 native.

Observed

Detached run holoself-sprint-31-34-v2: the meshloop resume --graph … process (spawned by run --detach) → node ml-harness.mjs claude <prompt> → claude -p …, all present in Win32_Process. At the same time, inspect --json showed node 1 state: Running, live: "Dead", pane_id: null. The worker exited normally 4.4 min later, and the node reached AwaitingReview.

Cause

CliHarness::session_live (crates/meshloop-adapters/src/harness.rs:182) returns Live only if the attempt is in this process's in-memory running registry. inspect runs in a different process from the detached resume that owns the child, so the registry is always empty there and every attempt reads Dead.

cancel is not affected: it kills by the persisted attempt.pid (main.rs ~1066). But live is shown to users and agents as if it were authoritative.

Expected

When the caller doesn't own the child, liveness comes from the persisted attempt PID: OS process existence plus a start-time check against PID reuse. It reports Ambiguous or unknown when that can't be determined, never Dead.

Acceptance criteria

  • Test: detached run with a long-running fixture worker → inspect from a separate process reports Live.
  • Test: worker exited → Dead. PID reused by an unrelated process → not Live.

🤖 Generated with Claude Code

Activity

  1. added
    bugSomething isn't working
    drafted-by:claudeIssue, plan, or spec drafted by Claude in the current session
    on Oct 7, 2026
  2. smota commented on Oct 7, 2026

    @smota
    OwnerAuthor

    Extra finding, checked on origin/main @ 09a823a:

    A PID-plus-identity check already exists. crates/meshloop-adapters/src/process.rs has orphan_identity_matches(pid, executable), with Windows and POSIX versions, which cancel uses through kill_orphaned_tree for workers this process didn't start (#30). session_live could fall back to it when the attempt isn't in the in-memory registry:

    • In the registry → Live (unchanged).
    • Not in the registry, handle.pid set and the identity matches → Live.
    • PID gone, or the identity doesn't match → Dead.
    • Can't tell (lookup error, no PID saved) → Ambiguous.

    status shows the same live field, so this fixes it there too.

  3. smota commented on Oct 7, 2026

    @smota
    OwnerAuthor

    Workflow status: delivered. PR #63 merged by smota as d058307 (2026-10-07).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdrafted-by:claudeIssue, plan, or spec drafted by Claude in the current sessionfor-implementation:claudeImplementation routed to Claude

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions