Skip to content

fix(child-sessions): close cancelled acquisitions and retain current progress evidence #428

Closed

Description

@tt-a1i

Problem

A post-#426 current-main audit at eaf470b reproduced child startup ownership and progress-projection defects:

  • Interrupting ordinary Pi child acquisition while the session factory is pending allows the late child to bind extensions after cancellation, with no abort/shutdown/dispose owner.
  • Cancelling Workflow during git worktree add leaves an empty checkout/branch because the cancellation throw precedes its cleanup try/finally.
  • With twenty 16-KiB tool results followed by an error, the 256-KiB transcript projection retains older results and drops the newest failure despite its first/newest retention contract.
  • Tool previews split an entire growing output buffer although only the first nonempty line is displayed; a bounded scan is under measurement.

Scope and validation

Deliver one bounded repair PR: preserve Pi lifecycle, user configuration, permissions and canonical messages; no new configuration or orchestration framework. Add deterministic acquisition/cancellation regressions, mixed-size latest-evidence tests, and an execution-shaped preview performance probe. Validate check/full tests and two independent reviews. Keep existing viewport/hydration/shell/terminal-artifact work in its own PRs (#327, #319, #423, #386).

Runtime provenance: this is an audit of current main in an isolated worktree. The user's configured Pi still reports openpi-main-runtime at c8f2c13; installed behavior is not automatically changed by a source merge.

Activity

  1. tt-a1i commented on Sep 7, 2026

    @tt-a1i
    CollaboratorAuthor

    Repair is ready in #429, left open for review.

    Canonical investigation and bounded preview measurements.

    Local bun run check and standard bun run test passed: 1446 Node tests, one platform skip, 30 Vitest tests. Two independent reviews are clean after also preserving isolated startup worktrees for pure/mixed interruptions when quiescence is unknown. Deterministic regressions cover late factory/binding, real Git post-checkout cancellation, dirty evidence, latest error retention and preview behavior. No user runtime, role files or settings changed. Exact-head remote CI passed on 342ac927736b64d12c8953e0c4c932eedecb3451: Node 22, Node 24 and Windows. No merge performed for this PR.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions