Skip to content

core: restart drops the execution claim for a directly resumed child session #63414

Closed

Description

@jlongster

Description

When a user continues a child session directly after its subagent job has finished, a restart mid-execution silently drops that work. The child still has a durable execution claim at shutdown. At startup releaseChildClaims clears it because there is no running job, and the sweep only resumes top-level claims.

OpenCode version

dev at 6b8c796, Linux, Bun 1.4.2

Steps to reproduce

  1. Create a parent and child in the core session-execution fixture. Call SessionExecution.resume(child) and hold the runner open.
  2. Close the execution scope. The child's time_suspended is still set.
  3. Build a fresh execution graph on the same database and run resumeSuspendedSessions. The child drains zero times, and its claim disappears. A claimed top-level session resumes in the same setup.

Expected: the child continues once, subject to the normal restart-attempt budget.

Activity

  1. opencodejr commented on Nov 11, 2026

    @opencodejr
    Contributor

    Not observed; this looks likely from reading the code.

    Thanks. I confirmed this by reading the code on dev at 6b8c796, which is also the latest dev right now. I didn't run the fixture.

    • In packages/core/src/session/execution/restart.ts, resumeSuspendedSessions builds children only from pending background jobs that are running subagent jobs. It then calls store.releaseChildClaims(children).
    • In packages/core/src/session/store.ts, releaseChildClaims clears time_suspended and resume_attempts on every child (parent_id set) not in that list. A child resumed directly with SessionExecution.resume(child) after its job finished loses its claim there.
    • The resume loop only covers store.listSuspended(), which filters on isNull(SessionTable.parent_id). Children are otherwise started only through recoverable subagent jobs, so nothing picks the directly resumed child back up.

    That matches what you describe: zero drains for the child and a vanished claim, while a claimed top-level session resumes in the same setup.

  2. added
    status/repro-plausible
    on Nov 11, 2026
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

    status/repro-plausible

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions