Skip to content

A settled or cancelled child stops its provider process after an idle time #1221

Done

Description

@scuttletoby

What: when a delegated child is settled or cancelled, the server stops its provider session after a configured idle time. The thread stays, and the next message to it resumes the session.

Why: a finished child keeps a provider process of 2-3 GB, and task_cancel does not end it. That memory counts against capacity, so new writers wait for slots.

Evidence: on one day, two top-priority fixes waited hours for a slot while finished children held memory.

Done when: a settled or cancelled child with no turn for N minutes has no process left, its memory is free and its slot counts as free. A message after that resumes the thread with its history. A child that gets a message before the timeout keeps its process.

State question: the child is resumed while it is being stopped; the server restarts during the wait; the child runs on a linked machine.

Related: #871 (makes idle memory visible).

🤖 Generated with Claude Code

Activity

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

    @scuttletoby
    OwnerAuthor

    Done on main by f930557 (#1036): with stopFinishedChildren.enabled (off by default; grace graceSeconds, 60 s), a delegated child whose task ended (completed, failed, cancelled, interrupted) and that stays idle has its own provider session stopped, a run or request that starts first keeps it (re-checked in the release step), a later message resumes the thread, and a child a linked machine sent is covered too.

    🤖 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:feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions