Repository navigation
Recover the pull request an implement session left unopened (#2231) - #2237
Merged
Merged
Conversation
Claude Code stops a session's remaining background work, a review sub-agent included, ten minutes after its last turn, then delivers the stop as an empty zero-turn result. That result cleared the killed work, so the session got no Resume and the Ticket run failed with a bare 'no PR found'. A notification-only result now ends no turn. When the pushed Issue branch has commits ahead of the Base branch but no pull request, Delivery opens it in the session's place; with no commits either, the Ticket run fails saying so. The code-review skill tells the session to wait for its reviewers before ending its turn.
A stop notification for a task whose kill a result already followed no longer counts as new killed work once its zero-turn result is skipped. The code-review skill says to start its reviewers in the foreground. Delivery's scripted tests record the new step and its failure.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Confirmed cause: when Claude Code reaches its background wait ceiling, it stops the session's remaining work and then delivers that stop as an empty, zero-turn
result(origin.kind: "task-notification"). That matches #73's0 turnsending and real Session traces on this machine (2302-…-implement-resume.logs.jsonl). thirdshift treated the empty result as a new turn and cleared the killed review. So the session got no Resume, and the Ticket run stopped at Pull request readiness with a bareno PR found.thirdshift-code-reviewskill now says to start both reviewers in the foreground, in one message (on Claude Code,run_in_background: false). It also says never to end the turn while a reviewer is still running. Prompts were regenerated.site/index.htmlandsite/how-it-works/say the same.implement: background work was killed as the session ended; resuming it once. If the run later fails, the cause names the review, for exampleimplement session ended with a background task still running (Spec review of issue-7), which was killed, and a later step failed: ….Evidence
Execution evidence
Before (on
main, at the stream seam):cargo test --bin thirdshift a_review_stopped_at_the_wait_ceilingAfter: the same test passes.
cargo test --bin thirdshift harness::interpretation:test result: ok. 100 passed; 0 failed.Before (Ticket run with fakes, with
notification_onlydisabled):cargo test --test background_work a_review_stoppedAfter:
test a_review_stopped_at_claudes_wait_ceiling_gets_its_session_resumed ... ok. All ofbackground_work:6 passed; 0 failed.Recovery (
cargo test --test pr_lifecycle an_implement_session): onmain, a session that opens no PR ends withno PR found(that was the old expectation intests/process_tree.rsandtests/codex_sessions.rs). After:2 passed.main.gh pr createis never called.A review finding, run as the reviewer wrote it, failed before the follow-up fix:
cargo test --bin thirdshift a_task_stopped_in_the_last_turn_stays_cleared→FAILED.Validation:
scripts/affected-tests main: site tests PASS, Console browser tests PASS.cargo test --bin thirdshift -- --skip sandbox::tests::→1897 passed; 0 failed.sandbox failed to start: socat is not on PATH, plus memory-cap Trial tests that need systemd scope OOM evidence.socatisn't on this machine and none of these tests touch Delivery or the Claude stream.run_notification,process_tree,codex_sessions,pr_lifecycle,background_work.cargo clippy --all-targetsis clean.npm run docs:check --prefix siteandcargo test --bin thirdshift prompts_pagepass.Visual evidence
None. The HTML changes add one sentence each inside existing paragraphs of
site/index.htmlandsite/how-it-works/index.html, plus regenerated text insite/docs/andsite/prompts/. No markup, styles or layout changed, so no screenshots were taken.Merge Danger
Door: two-way
Blast Radius: Delivery
Unaddressed findings
Standards
publish_steps: declined.deliverystep opens a draft whenever none exists, as the guide's Custom process section documents.open_missing_prworded for an implement session but also on the Spec PR path: declined.src/spec_run.rs,landed), soactionable_head(false)either returns early or fails withno PR foundas before.Spec
a_run_that_fails_after_a_review_stopped_at_the_ceiling_names_the_review_in_its_causeandtests/run_notification.rs.Review coverage: the reviewers read every changed file at
c2663ce7, except two generated files excluded with regeneration evidence:site/docs/index.html(fromdocs/guide.md,npm run docs:check --prefix site) andsite/prompts/index.html(fromskills/,cargo test --bin thirdshift prompts_page). The follow-up commits changed some files after the review:tests/codex_sessions.rs,tests/run_notification.rs,tests/process_tree.rs(expectation updates only).src/delivery/tests.rs.src/harness/interpretation/stream.rs,src/delivery/test_support.rs,src/skills/tests.rsandskills/thirdshift-code-review/SKILL.md.Closes #2231
Built with claude 2.1.322 · claude-opus-5-5 · high
Security review outcome
No unaddressed introduced findings.