Skip to content

Provide durable reconciliation for orphaned child turns after process loss #54428

Open

Description

@erickb336

Durable reconciliation for an orphaned V2 child turn

Tracking use case: erickb336/sage-stack#246. Please identify an existing supported recovery contract or consider the operation described below.

Sage needs native evidence that an interrupted child can no longer execute its old turn. A display status alone cannot authorize capacity release or reassignment.

Observed behavior

The reproduction used the native Codex CLI 0.160.0, an isolated profile, and fixed simulated Responses output. It made no real model calls.

  • A clean input shutdown persisted a child interruption record.
  • Abrupt loss of the tracked native process left the child transcript without a terminal record through the observed restart phases.
  • Resuming the root did not restore the child in the live registry or issue a child model request.
  • Loading the saved child through its recorded parent produced a pending child, not a resumed turn. The API displayed the old turn as interrupted; the inspected transcript did not gain a terminal record.

These observations cover that reproduction. They do not establish that every supported recovery path is unavailable.

The reproducible harness is in Sage PR #247, at commit 02d306608da424ef6611965fb09426fa70e8a419. Its instructions and evidence limits distinguish clean EOF, direct native loss, and saved-child loading. Raw captures remain local and contain no real model calls.

Source audit and version limits

The source audit covers 0.162.1, commit 092d3acd6bec3e3a14bdc7e7a2810ab628ab759d. Native reproduction covers 0.160.0 only. At submission, 0.163.0 is the latest published release; it has not been source-audited or native-tested in this investigation.

  • V2 parent interruption explicitly does not reload an absent child. An unloaded or already-dead runtime can return success. This file is unchanged from 0.160.0.
  • Saved-child loading requires the recorded immediate parent to be loaded. It delegates to that parent's agent control.
  • Turn interruption requires a matching active turn for a normal turn request. The empty-turn startup path does not wait for a turn-aborted event.
  • Response normalization changes returned turn statuses when the thread is not active. That function does not persist a terminal record.
  • Persistence resume selects history under writer ownership, then opens the existing recorder. The recorder resume branch starts with no pending items.
  • The active task abort path emits an exact turn-aborted event and flushes it. It requires the live task being aborted.

The inspected paths do not establish a durable settlement contract for an old turn with no live task. The newer history-revision check improves replay freshness; it is not a crash receipt.

Requested contract

Please identify an existing supported operation, or consider a parent-owned reconciliation operation, with these guarantees:

  1. Bind the persisted result to the recorded root, immediate parent, child, and exact old turn. Sage can then join those native identifiers to its immutable assignment.
  2. Establish exclusive authority before settling the old execution. Refuse a competing writer, changed history, foreign parent, or uncertain live owner.
  3. Persist a distinct interruption or crash-reconciliation outcome before returning success. Do not fabricate a report or successful completion.
  4. Make retries idempotent. Preserve the old history, and reject a conflicting request or later turn.
  5. Require no child model turn, prepared follow-up, prompt injection, or direct edit of the saved transcript.
  6. Document incomplete storage-write behavior and the boundary of the guarantee across local processes, remote hosts, and copied profiles.

Current consumer behavior

Recommendation: retain the reservation and request supported native reconciliation evidence.

An alternative would be an explicit abandonment operation with its own outcome and a guarantee against overlapping execution. Sage has not implemented that policy. A missing process, elapsed time, API display status, or successful no-op interrupt is not enough.

This request is separate from fail-closed hook activation and trusted tool execution-context capture.

Activity

  1. added
    enhancement
    CLI
    app-server
    subagent
    on Oct 15, 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

    CLIapp-serverenhancementsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions