Skip to content

fix(session): persist interrupted child sessions - #260

Open
Sam Schillace (ramparte) wants to merge 1 commit into
microsoft:mainfrom
ramparte:fix/persist-interrupted-subsession
Open

fix(session): persist interrupted child sessions#260
Sam Schillace (ramparte) wants to merge 1 commit into
microsoft:mainfrom
ramparte:fix/persist-interrupted-subsession

Conversation

@ramparte

Copy link
Copy Markdown
Contributor

Summary

  • Persist interrupted spawned and resumed child sessions with status: interrupted, preserving the partial transcript and reconstruction metadata for later recovery.
  • Centralize child lifecycle teardown so completion-hook registration, cancellation propagation, display nesting, and child cleanup are each released exactly once, even under repeated cancellation or teardown failures.
  • Close the pre-save cancellation race by preparing persistence state before execution and recovering when cancellation lands either during execution or during the post-execute transcript read.
  • Shield the single finalizer task so subsequent cancellation cannot interrupt persistence or cleanup, while preserving the original cancellation for the caller.
  • Ignore .next/ working-session artifacts.

This is the coordinated prerequisite for the Foundation delegate-timeout rollout: Foundation can release the parent promptly at its deadline while this app layer completes interrupted-child persistence and cleanup in the detached task.

Verification

  • 12 focused interruption/lifecycle tests passed.
  • 142 relevant session-spawner and resumption tests passed.
  • 1,313 full-suite tests passed, with the repository's known skips/deselections.
  • Ruff clean.
  • Pyright clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant