Repository navigation
The Failed run path - #19
Merged
Merged
Conversation
Any failure after the worktree exists commits the agent's work (aborting an unfinished merge first), pushes it unless the branch has no changes against the Base branch, converts an open PR back to a draft, and reports the session log. SIGINT and SIGTERM stop the session's process group and take the same path. A draft PR left by the agent is marked ready on success. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…terrupts Gather the Failed run path into failed_run.rs with a FailedRun type, keep the failure reason to one line, honour an interrupt that arrives after the session, replace the draft flag with mark_ready/convert_to_draft, share the git and gh command plumbing, and assert stdout on every Failed run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in pre-flight checks (#16), the README (#15) and merging the Base branch with conflict Repair (#17) on top of the Failed run path. - run.rs: preflight::check replaces the inline origin check; the Repair session and final push sit inside implement(), so a failed Repair goes down the Failed run path. The session log reported on failure is the most recent one (repair-1 if it ran). - main.rs: parse the Issue URL up front (exit 2) as main does, then install the interrupt handler and report a FailedRun. - github.rs: main's gh_json/string_field helpers, plus isDraft, is_open, mark_ready and convert_to_draft. - failed_run.rs: reuses Worktree::merge_in_progress. - tests/mergeable.rs: a failed Repair is now a Failed run, so it prints the open PR's URL and sends the PR back to draft. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in the progress lines (#18) on top of the Failed run path. - session.rs: the stream is followed on its own thread, so the main thread can still poll for an interrupt and stop claude's process group. A follow error kills the group, as main's child.kill() did. - run.rs: keeps the Failed run structure and adds main's progress steps; session::run now takes the session kind. - main.rs, failed_run.rs: stderr lines go through progress::step. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
5 tasks done
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
Any failure after the worktree exists now goes down the Failed run path. A draft PR the agent leaves is marked ready.
Tested seams: the
thirdshiftCLI only (tests/failed_run.rs,tests/fresh_run.rs). Tests run the real binary against real git and fakegh/claude, and SIGINT/SIGTERM are sent to the process.Evidence
claudeexits 3 with uncommitted work → stderr is onlythirdshift: claude exited 3, no failure commit orissue-7on origin, no log path. A SIGINT during the session → the test waits the full 30s (the session was not stopped). A draft PR from the agent →isDraftstaystrue.cargo test→ 17 passed (8failed_run, 9fresh_run), including:cargo fmt --checkandcargo clippy --all-targets -D warningsare clean.Merge Danger
Door: two-way
It adds new behaviour on the failure path; the happy path is unchanged except that a draft PR now gets marked ready. It adds
signal-hookandlibcdependencies.Blast Radius: contained
A Failed run now pushes an Issue branch and demotes the PR, which is the behaviour the spec asks for.
claudenow runs in its own process group, so a terminal Ctrl-C reaches it only through thirdshift.Unaddressed findings
Standards
implement/failshare issue, worktree, base, log): two private call sites. A context struct would add ceremony before Continuations and Repairs show what a Run context really needs.Interruptederror): the reason string is the spec'd output (interrupted). A PRis_open()was added; a full PR state enum is left for when more states matter.interrupt::requested()checks: each guards a different window (before the worktree, during the session, after the session, error translation). Merging them would drop one of those windows.Spec
--no-verifyon the failure commit: kept on purpose, because a repo hook that rejects the commit would strand the agent's work, which is the one thing the failure path exists to prevent.claudespawns.Closes #5
🤖 Generated with Claude Code