Skip to content

fix(subagents): close cancelled startup and preserve current progress evidence - #429

Merged
tt-a1i merged 2 commits into
mainfrom
codex/workflow-runtime-audit
Sep 7, 2026
Merged

fix(subagents): close cancelled startup and preserve current progress evidence#429
tt-a1i merged 2 commits into
mainfrom
codex/workflow-runtime-audit

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Problem

Cancelling child startup could leave a late Pi session alive or an empty Workflow worktree behind. Large tool output also hid newest failure evidence and made every live preview split content the UI never displayed. Reproduced on main after #426; fixes #428.

Value

Cancellation retains cleanup ownership, recent failures remain visible under transcript pressure, and live tool previews avoid unnecessary allocations. Existing permissions, configuration and canonical Pi messages remain unchanged.

Approach

  • Own ordinary session acquisition before asynchronous startup; stop late extension binding and use bounded, deduplicated cleanup. Preserve isolated startup checkouts when interruption leaves quiescence unknown, including interruption combined with cleanup failure.
  • Put Workflow's post-worktree-acquisition cancellation check inside its existing cleanup region, retaining dirty work and recovery receipts.
  • Allocate transcript byte budget to the initial task and newest evidence, then restore chronological display and metadata.
  • Read only the first meaningful preview line within the existing consumer limit instead of splitting the complete log.

Validation

bun run check passed; standard bun run test passed 1446 Node tests with one platform skip and Vitest 30/30. Two independent reviews found no remaining issues after the worktree interruption classification refinement. Deterministic regressions cover delayed session factory/bind cancellation, real Git post-checkout cancellation, dirty-work preservation, byte-pressure final errors and preview allocation behavior. Local diagnostic preview measurements and limitations are recorded in the research document; they are not application-wide speedup claims.

Exact-head remote CI passed on 342ac927736b64d12c8953e0c4c932eedecb3451: Node 22, Node 24 and Windows. Fixed review base: eaf470bab4ac2dda607d16c6ddee66dc35367527.

Impact

No new model tools, permissions, settings or persisted schema. Display selection under byte pressure now prioritizes the latest evidence. Cancellation cleanup follows existing empty/dirty/uncertain worktree policy. An interrupted ordinary startup may intentionally retain an empty checkout until its asynchronous work is known to have stopped; the error reports its path and branch. User runtime and role files were preserved. This PR is for review and will not be merged automatically.

Investigation: child acquisition and progress audit. Viewport/history/shell and unrelated Cursor large-frame copying are outside this bounded repair.

@github-actions github-actions Bot added documentation Improvements or additions to documentation area:workflows Workflow engine, capability, skills, or tests area:subagents Subagent delegation, skills, or tests labels Sep 7, 2026
@tt-a1i
tt-a1i merged commit 6e6f344 into main Sep 7, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:subagents Subagent delegation, skills, or tests area:workflows Workflow engine, capability, skills, or tests documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant