issue-worker¶
Implements approved issues as pull requests -- the job that turns plans into code.
| Property | Value |
|---|---|
| Type | Interval |
| Default interval | 5 minutes (intervals.issueWorkerMs) |
| Uses AI | Yes |
| Backend | Claude (configurable via jobAi) |
| Config key | intervals.issueWorkerMs |
What it does¶
The issue-worker is the implementation engine. When an issue is approved with the Refined label, this job creates an isolated git worktree, runs Claude with the implementation plan, and opens a pull request with the resulting changes.
It handles both single-PR and multi-PR implementations, tracking phase progress across the lifecycle of complex issues.
Trigger¶
- Issues with the
Refinedlabel (new implementation) - Open issues with merged Yeti PRs but remaining phases (multi-PR continuation)
Labels¶
| Label | Action |
|---|---|
Refined |
Requires (to start implementation) |
Refined |
Removes (after creating PR or if PR already exists) |
Ready |
Removes (when starting implementation) |
In Review |
Sets (after creating PR) |
Priority |
Propagates from issue to new PR |
Refined |
Sets (re-labels issue for next multi-PR phase after merge) |
How it works¶
Single-PR Implementation¶
- Checks for an existing open PR for the issue (skips if found, removes
Refined) - Removes the
Readylabel - Creates a git worktree on branch
yeti/issue-<number>-<hex4> - Reads the
## Implementation Plancomment from the issue - Runs Claude with the plan, issue body, and all comments
- Tree-diff guard: Only pushes if there are both new commits AND actual tree differences vs. the default branch
- Generates a PR description summarizing the changes
- Creates PR titled
fix: resolve #<N> -- <issue title>with body ending inCloses #<N> - Adds
In Reviewlabel to the issue - Propagates
Prioritylabel to the PR if the issue has it - Removes
Refinedlabel
Multi-PR Implementation¶
When the plan specifies multiple phases (using ### PR 1: ..., ### PR 2: ... format):
- Determines the current phase based on how many PRs have already been merged
- Posts a progress comment on the issue:
## Phase Progress - Builds a phase-aware prompt -- Claude sees the full plan but is told to implement only the current phase
- Creates PR titled
fix(#<N>): <phase title> (<M>/<total>) - Intermediate PRs: body says
Part of #<N> - Final PR: body says
Closes #<N>
Phase Continuation¶
After a multi-PR phase is merged:
- The worker detects open issues with merged Yeti PRs but remaining phases
- Confirms no open PR currently exists
- Re-adds the
Refinedlabel to trigger the next phase - On the next poll cycle, the standard flow picks up the issue again
Guards¶
- Duplicate PR guard: Uses
getOpenPRForIssuewith cache bypass (fresh: true) to prevent race conditions where a concurrent PR is invisible during the 60-second cache window - Tree-diff guard: Checks both
hasNewCommits(commit count) andhasTreeDiff(actual tree difference viagit diff --quiet) before pushing. This prevents failures when commits produce no effective changes.
Related jobs¶
- issue-refiner -- Produces the plans this job implements
- ci-fixer -- Fixes CI failures on the PRs this job creates
- review-addresser -- Addresses review comments on the PRs this job creates
- auto-merger -- Merges the PRs this job creates