Skip to content

Delegated tasks on an unreachable environment stay 'running' forever #1207

Backlog

Description

@scuttletoby

When a linked environment stops answering, the delegated tasks running there stay "running" in the parent thread indefinitely (activity "unknown"). Seen: four tasks shown as running for about 15 hours after the remote machine went offline. They held slot-filler slots and hid work that needed a takeover until someone noticed by hand.

Want:

  • After the environment has been unreachable for a configurable time (default e.g. 30 min), mark its running tasks as lost (a distinct state, not failed or cancelled). Show it in task_list and in the thread UI.
  • The parent gets one notification per lost task, with the task's brief/title, so it can requeue.
  • Slot counting treats lost as free.
  • If the environment comes back and the child is still alive, the task returns to running and the parent is told. A late duplicate push is then possible, so the notice says so.
  • task_cancel on an unreachable environment already says "may still run there"; keep that. When the environment comes back, deliver the cancel then.

Test: unreachable env + running task -> lost after the timeout; env back -> running again; cancel while unreachable -> delivered on reconnect.

🤖 Generated with Claude Code

Activity

  1. scuttletoby commented on Nov 28, 2026

    @scuttletoby
    OwnerAuthor

    One more part, on placement, from a review of which written orchestrator rules should become code: before the slot filler picks a machine, it asks the server whether that machine is reachable. When the machine is not reachable, the filler reports that as the reason; today it reports a misleading parent_not_active. This goes together with lost here and the availability signal in #884.

    Evidence (one outage of about 13 hours): 210 parent_not_active errors in the filler log, and 25 queue items moved by hand.

    🤖 Generated with Claude Code

  2. added
    area:agents
    size:medium
    type:bug
    on Nov 29, 2026
  3. scuttletoby commented on Nov 29, 2026

    @scuttletoby
    OwnerAuthor

    Status on main: the placement part (the 11-28 comment) is done by 1111321 (#1243). The slot filler now asks GET /api/fork/delegate/links once per run and skips a machine listed unreachable or expired, and a refusal's log line names machine unreachable or parent idle instead of a bare parent_not_active. Left here: the lost task state with its timeout, the parent's notice, slot counting, the return to running, and delivering a cancel on reconnect.

    🤖 Generated with Claude Code

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

    area:agentssize:mediumtype:bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions