Skip to content

fix: preserve Stop-hook continuation after Channel B completion - #5284

Merged
Trecek merged 6 commits into
developfrom
impl-channel-b-completion-authority-20261016-073542
Oct 16, 2026
Merged

Trecek merged 6 commits into
developfrom
impl-channel-b-completion-authority-20261016-073542

Conversation

@Trecek

@Trecek Trecek commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

A Channel B transcript marker can arrive while Claude is running a blocking Stop hook. Managed lifecycle runs could treat that marker as completion authority, SIGTERM the live worker before its continuation, and report the termination as natural_exit.

Remove Channel B candidate state so completion eligibility starts only from native Channel A terminal evidence. Preserve admitted Channel B corroboration after an observed exit, require an observed exit for NO_KILL, and label synchronous timeout kills as infrastructure kills.

Regression coverage invokes the real required-join Stop dispatcher and checks blocked continuation, approved completion, natural exit, timeout/cancellation cleanup, PTY behavior, pending-child deferral, and ScheduleWakeup deferral. AST guards pin completion-candidate ownership to the native terminal watcher. Existing process and session-binding test helpers are shared across the coverage.

Validation:

  • pre-commit run --all-files passed.
  • Configured task test-local-gate: 47,551 passed, 613 skipped, 29 xfailed.
  • Original issue probe: continuation ran, return code 0, Channel A confirmation.
  • All three planned mutations were detected by their intended tests and restored.

The local gate excludes tests/execution/test_process_channel_b.py; its existing CI shard remains the verification gate for that file.

Closes #5283.

@Trecek
Trecek added this pull request to the merge queue Oct 16, 2026
Merged via the queue into develop with commit a62191b Oct 16, 2026
11 checks passed
@Trecek
Trecek deleted the impl-channel-b-completion-authority-20261016-073542 branch October 16, 2026 19:59
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